.work-content {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remove-quota {
  margin-left: 7px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #a34b4b;
  font-size: 16px;
}
.effective-tag {
  margin-left: 7px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #e9f7f4;
  color: #08766f;
  font-size: 10px;
  font-weight: 500;
}
.tree-table .tree-name > .tree-item-label { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; gap: 5px; }
.tree-table .tree-item-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.indicator-tag { flex: 0 0 auto; margin-left: 4px; padding: 1px 6px; border: 1px solid #e2ae45; border-radius: 4px; color: #7a4c00; background: #fff0c4; font-size: 12px; font-weight: 800; line-height: 16px; }
.tree-table [data-col="type"] { width: 48px; min-width: 48px; padding-inline: 1px; text-align: center; }
.directory-type { display: inline-block; min-width: 30px; padding: 1px 3px; border-radius: 3px; color: #536f87; background: #edf3f7; font-size: 11px; font-weight: 700; line-height: 16px; }
.directory-type-select { width: 44px; min-width: 44px; height: 20px; padding: 0 12px 0 3px; border: 1px solid #b8cfdf; border-radius: 3px; appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%23365d7d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 3px center / 8px 5px; color: #365d7d; font: inherit; font-size: 11px; font-weight: 700; line-height: 16px; cursor: pointer; }
.directory-type-select:focus { border-color: #2580c4; outline: 0; box-shadow: 0 0 0 2px rgba(37,128,196,.14); }
.directory-type-指标 { color: #7a4c00; background: #fff0c4; }
.directory-type-小计 { color: #086f73; background: #e2f6f3; }
.directory-type-合计 { color: #245d9a; background: #e5efff; }
.chapter-insert-dialog { width: min(520px, calc(100vw - 32px)); border: 0; padding: 0; border-radius: 12px; overflow: hidden; }
.chapter-insert-dialog::backdrop { background: rgba(27, 48, 68, .32); }
.chapter-insert-form { background: #fff; }
.chapter-insert-body { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 22px 24px 20px; }
.chapter-insert-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 10px; background: #e4f1fc; color: #176bc1; font-size: 26px; font-weight: 500; }
.chapter-insert-body small { display: block; color: #70869a; font-size: 11px; }
.chapter-insert-body strong { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: #234561; font-size: 16px; }
.chapter-insert-body code { padding: 2px 6px; border-radius: 4px; background: #edf3f8; color: #1c6194; font-size: 12px; }
.chapter-insert-body p { margin: 12px 0 8px; color: #526b80; font-size: 13px; line-height: 1.6; }
.chapter-insert-body ul { margin: 0; padding-left: 18px; color: #71879a; font-size: 12px; line-height: 1.8; }

.tree-name {
  padding-left: calc(var(--tree-depth, 0) * 18px);
}

.tree-name.work .branch {
  color: #9aabbb;
}

body.workspace-mode { overflow: hidden; }
body.workspace-mode #appView > .topbar { display: none; }
body.workspace-mode .workspace-page { height: 100vh; }
.workspace-titlebar { min-height: 58px !important; padding: 7px 12px !important; }
.workspace-actions { display: flex; gap: 6px; align-items: center; }
.workspace-actions button { padding: 7px 10px; font-size: 12px; }
.workbench-v2 { grid-template-columns: minmax(240px, 18%) minmax(560px, 1fr) minmax(260px, 19%); gap: 2px; }
.workspace-center { --upper-pane-height: 55%; grid-template-rows: minmax(180px, var(--upper-pane-height)) 5px minmax(180px, 1fr); gap: 0; }
.tree-tools { display: flex; gap: 4px; padding: 7px 8px; border-bottom: 1px solid var(--line2); background: #f8fafc; }
.tree-tools button { border: 0; border-radius: 5px; padding: 5px 8px; background: transparent; color: #5c6e7d; font-size: 11px; }
.tree-tools button.active { background: #e5f1fb; color: #0e5aa7; font-weight: 700; }
.tree-table .rowno { width: 42px; }
.tree-table td { vertical-align: top; }
.tree-table .tree-name { min-width: 180px; white-space: normal; line-height: 1.45; }
.tree-table tr.selected td { background: #dceeff !important; color: #0d4f85; }
.property-pane { display: flex; min-width: 0; flex-direction: column; background: #fff; }
.property-scroll { flex: 1; min-height: 0; overflow: auto; background: #fff; }
.property-group { border-bottom: 1px solid var(--line2); }
.property-group h3 { margin: 0; padding: 6px 10px; background: #eaf0f5; color: #264a66; font-size: 12px; font-weight: 800; line-height: 1.2; }
.property-group dl { margin: 0; }
.property-group dl > div { display: grid; grid-template-columns: 118px minmax(0,1fr); min-height: 25px; border-top: 1px solid #edf0f3; }
.property-group dt, .property-group dd { min-width: 0; margin: 0; padding: 5px 7px; font-size: 11px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.property-group dt { border-right: 1px solid #edf0f3; background: #f7f9fb; color: #526b7e; }
.property-group dd { color: #19364c; background: #fff; }
.property-inline-input, .property-inline-select { width: 100%; min-width: 0; height: 24px; box-sizing: border-box; margin: -4px -5px; padding: 2px 22px 2px 5px; border: 1px solid transparent; border-radius: 4px; background-color: transparent; color: #19364c; font: inherit; line-height: 18px; outline: none; }
.property-inline-input { padding-right: 5px; }
.property-inline-input:hover, .property-inline-select:hover { border-color: #c5d8e7; background-color: #f8fbfd; }
.property-inline-input:focus, .property-inline-select:focus { border-color: #3c8dcc; background-color: #fff; box-shadow: 0 0 0 2px rgba(60,141,204,.12); }
.property-inline-input:disabled, .property-inline-select:disabled { opacity: .65; }
.property-inline-unit { display: flex; min-width: 0; align-items: center; gap: 4px; }
.property-inline-unit .property-inline-input { flex: 1; margin-right: 0; }
.property-inline-unit i { color: #6f8495; font-style: normal; }
.property-long-edit { display: block; width: calc(100% + 10px); min-width: 0; margin: -4px -5px; padding: 4px 5px; overflow: hidden; border: 0; border-radius: 4px; background: transparent; color: #24597e; font: inherit; line-height: 16px; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.property-long-edit:hover { background: #edf6fd; color: #0c5f9e; }
.property-group dd .property-number { color: #125d96; font-weight: 800; font-variant-numeric: tabular-nums; }
.property-note { margin: 0; padding: 6px 9px; border-top: 1px dashed #dbe5ed; color: #62798c; background: #fbfdff; font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.property-calculation-link { margin-left: 4px; padding: 2px 5px; border: 0; border-radius: 3px; background: #e5f1fb; color: #1264a3; font-size: 10px; font-weight: 700; cursor: pointer; }
.property-calculation-link:hover { background: #cfe6f8; }
.property-formula-entry { display: flex; min-width: 0; align-items: center; gap: 5px; }
.property-formula-entry code { min-width: 0; flex: 1; overflow: hidden; color: #24597e; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
.property-formula-entry button { flex: 0 0 auto; margin: -3px -4px -3px 0; padding: 2px 6px; border: 1px solid #b8d3e7; border-radius: 4px; background: #edf6fd; color: #0c5f9e; font-size: 10px; font-weight: 700; }
.property-formula-entry button:hover { border-color: #70a8d0; background: #dceefa; }
.other-fee-formula-dialog { width: min(1120px, calc(100vw - 56px)); max-width: none; height: min(820px, calc(100dvh - 48px)); max-height: none; overflow: hidden; border: 1px solid #bfd0de; border-radius: 11px; background: #fff; }
.other-fee-formula-dialog::backdrop { background: rgba(39,60,79,.22); backdrop-filter: none; }
.other-fee-formula-form { display: flex; height: 100%; flex-direction: column; overflow: hidden; }
.other-fee-formula-dialog .dialog-head { flex: 0 0 auto; padding: 18px 24px 14px; background: linear-gradient(90deg,#fff,#f7fbfe); }
.other-fee-formula-dialog .dialog-head h3 { font-size: 22px; }
.other-fee-formula-dialog .dialog-head p:last-child { margin: 7px 0 0; color: #607b91; font-size: 13px; }
.other-fee-formula-body { min-height: 0; flex: 1 1 auto; overflow: auto; scrollbar-gutter: stable; }
.other-fee-formula-body section { padding: 14px 24px; border-bottom: 1px solid #e5edf3; }
.other-fee-formula-body h4 { margin: 0 0 6px; color: #275572; font-size: 14px; }
.other-fee-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.other-fee-section-hint { margin: 4px 0 0; color: #73899c; font-size: 11px; line-height: 1.55; }
.other-fee-formula-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; padding-top: 10px; }
.other-fee-formula-grid .span2 { grid-column: span 2; }
.other-fee-formula-body section:first-child .other-fee-formula-grid { grid-template-columns: minmax(280px,.8fr) minmax(420px,1.4fr); align-items: end; }
.other-fee-formula-body section:first-child .other-fee-formula-grid .span2 { grid-column: auto; }
#managementFeeEditor > .other-fee-formula-grid,#supervisionFeeEditor > .other-fee-formula-grid,.special-fee-grid { grid-template-columns: repeat(4,minmax(0,1fr)); padding: 8px 0 2px; }
#managementFeeEditor > .management-adjustment-grid,#supervisionFeeEditor > .management-adjustment-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding-top: 0; }
.other-fee-formula-grid label { min-width: 0; margin-bottom: 12px; }
.other-fee-formula-grid input,.other-fee-formula-grid select { width: 100%; min-width: 0; height: 38px; padding: 7px 10px; }
.other-fee-formula-grid label > small { margin-top: -4px; color: #7c92a4; font-size: 11px; font-weight: 400; }
.other-fee-formula-grid input:disabled { color: #2a5d83; background: #f3f8fc; font-weight: 700; }
.formula-scope-mode { display: flex; gap: 8px; margin: 12px 0 8px; }
.formula-scope-mode label { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 12px; border: 1px solid #cbdbe7; border-radius: 6px; background: #f7fafc; color: #355d78; cursor: pointer; }
.formula-scope-mode label:has(input:checked) { border-color: #3b8dca; background: #eaf5fd; color: #0b639f; font-weight: 700; }
.formula-scope-mode input { width: auto; height: auto; margin: 0; }
.formula-scope-card { margin-top: 8px; padding: 11px 13px; border: 1px solid #d6e2eb; border-radius: 7px; background: #fbfdff; }
.formula-scope-card > strong { display: block; margin-bottom: 8px; color: #345c77; font-size: 12px; }
.formula-scope-card label { display: block; margin: 0; color: #425f73; font-size: 12px; font-weight: 600; }
.formula-scope-card input,.formula-scope-card select { width: 100%; height: 36px; margin-top: 5px; padding: 6px 9px; }
.formula-picker-input { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
.formula-picker-input button { height: 36px; margin: 5px 0 0; padding: 0 13px; white-space: nowrap; }
.formula-inline-fields { display: grid; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); align-items: end; gap: 8px; }
.formula-inline-fields > span { padding-bottom: 9px; color: #6b8293; text-align: center; }
.formula-deduction-card { border-left: 3px solid #df9a4c; background: #fffdf8; }
.formula-match-preview { min-height: 17px; margin: 6px 0 0; color: #6b8293; font-size: 11px; line-height: 1.45; }
.formula-match-preview.valid { color: #28704d; }
.formula-match-preview.invalid { color: #a4541d; }
.fixed-rate-value-grid { padding-top: 12px; }
.formula-item-picker { margin-top: 9px; overflow: hidden; border: 1px solid #9fc5e0; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(40,76,103,.10); }
.formula-item-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #dbe7ef; background: #eef7fd; }
.formula-item-picker-head strong { display: block; color: #145f94; font-size: 13px; }
.formula-item-picker-head small { display: block; margin-top: 2px; color: #71879a; font-size: 10px; }
.formula-item-picker-tools { display: grid; grid-template-columns: minmax(220px,1fr) auto auto; gap: 7px; padding: 8px 10px; border-bottom: 1px solid #e4ecf2; }
.formula-item-picker-tools input { height: 32px; min-width: 0; padding: 5px 9px; }
.formula-item-picker-columns,.formula-item-picker-row { display: grid; grid-template-columns: 155px 180px minmax(260px,1fr) 72px; align-items: center; }
.formula-item-picker-columns { min-width: 720px; padding: 6px 10px; background: #f6f9fb; color: #647f92; font-size: 10px; font-weight: 700; }
.formula-item-picker-rows { max-height: 285px; overflow: auto; }
.formula-item-picker-row { min-width: 720px; min-height: 32px; padding: 0 10px; border-top: 1px solid #edf2f5; color: #345267; font-size: 11px; }
.formula-item-picker-row:hover { background: #f3f9fd; }
.formula-item-picker-row.selected { background: #edf7ff; }
.formula-item-picker-row > span { min-width: 0; overflow: hidden; padding: 5px 7px; text-overflow: ellipsis; white-space: nowrap; }
.formula-tree-select { display: flex; min-width: 0; align-items: center; gap: 5px; padding-left: calc(var(--formula-depth,0) * 15px); }
.formula-tree-select input { width: 15px; height: 15px; flex: 0 0 auto; margin: 0; }
.formula-tree-toggle { width: 20px; height: 22px; flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: #476b82; }
.formula-tree-toggle.placeholder { visibility: hidden; }
.formula-tree-kind { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formula-picker-code { color: #1b5e8e; font-family: Consolas,monospace; }
.formula-picker-type { color: #667f91; }
.formula-item-picker-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 9px 10px; border-top: 1px solid #dbe7ef; background: #fbfdff; }
.management-rate-table { overflow-x: auto; margin: 4px 0 12px; border: 1px solid #d5e1ea; border-radius: 7px; background: #fff; }
.management-rate-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.management-rate-table th { padding: 8px 10px; background: #eaf2f8; color: #365b75; text-align: left; white-space: nowrap; }
.management-rate-table td { padding: 7px 10px; border-top: 1px solid #e4ebf1; color: #29475d; }
.management-rate-table td.number { text-align: right; font-variant-numeric: tabular-nums; }
.management-rate-table input { width: 112px; height: 30px; border: 1px solid #cad5e1; border-radius: 5px; padding: 4px 8px; text-align: right; }
.management-rate-table .rate-changed { border-color: #e19a4b; background: #fff8ec; color: #8b5011; font-weight: 700; }
.management-rate-table tr.rate-active td { background: #eef8ff; }
.management-rate-table tr.rate-active td:first-child { box-shadow: inset 3px 0 #3a8dcc; color: #145f98; font-weight: 800; }
.management-adjustment-grid { padding-top: 0; }
.management-fee-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.management-fee-preview.supervision-fee-preview { grid-template-columns: repeat(3,minmax(0,1fr)); }
.management-fee-preview span { padding: 12px 14px; border: 1px solid #cfe0ec; border-radius: 7px; background: #f5faff; }
.management-fee-preview small { display: block; margin-bottom: 4px; color: #71879a; }
.management-fee-preview strong { color: #1264a3; font-size: 18px; font-variant-numeric: tabular-nums; }
.supervision-interval-hint { margin: -5px 0 9px; padding: 7px 10px; border-left: 3px solid #67a7d3; background: #f3f9fd; color: #416c89; }
.other-fee-formula-dialog .consent-note { flex: 0 0 auto; margin: 0; padding: 10px 24px; border-top: 1px solid #e5edf3; background: #fff; }
.other-fee-formula-dialog .dialog-actions { flex: 0 0 auto; min-height: 64px; align-items: center; background: #fbfdff; }
@media (max-width: 900px) {
  .other-fee-formula-body section:first-child .other-fee-formula-grid,#managementFeeEditor > .other-fee-formula-grid,#supervisionFeeEditor > .other-fee-formula-grid,.special-fee-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .management-fee-preview.supervision-fee-preview { grid-template-columns: 1fr; }
  .formula-scope-mode { flex-direction: column; }
  .formula-item-picker-tools { grid-template-columns: 1fr 1fr; }
  .formula-item-picker-tools input { grid-column: span 2; }
}
.segment-properties-form { width: 100%; max-height: min(900px, calc(100vh - 36px)); display: flex; flex-direction: column; overflow: hidden; }
#segmentPropertiesDialog { width: min(1080px, calc(100vw - 40px)); max-width: none; height: min(900px, calc(100dvh - 36px)); max-height: none; padding: 0; overflow: hidden; border: 1px solid #bfd0de; border-radius: 11px; background: #fff; }
#segmentPropertiesDialog > #segmentPropertiesForm { height: 100%; max-height: none; overflow: hidden; }
#segmentPropertiesDialog::backdrop { background: rgba(39, 60, 79, .18); backdrop-filter: none; }
#segmentPropertiesDialog .dialog-head { flex: 0 0 auto; padding: 18px 24px 14px; background: linear-gradient(90deg, #fff, #f7fbfe); }
#segmentPropertiesDialog .dialog-head h3 { font-size: 22px; }
#segmentPropertiesDialog .dialog-head p:last-child { margin: 7px 0 0; color: #607b91; font-size: 13px; }
#segmentPropertiesDialog .segment-properties-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 0; }
#segmentPropertiesDialog .segment-properties-body section { padding: 13px 24px 3px; border-bottom: 1px solid #e5edf3; }
#segmentPropertiesDialog .segment-properties-body h4 { margin: 0 0 4px; color: #275572; font-size: 13px; }
#segmentPropertiesDialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; padding: 10px 0 1px; }
#segmentPropertiesDialog .form-grid label { min-width: 0; margin-bottom: 12px; }
#segmentPropertiesDialog .form-grid input, #segmentPropertiesDialog .form-grid select { width: 100%; min-width: 0; height: 38px; padding: 7px 10px; }
#segmentPropertiesDialog .form-grid label > small { margin-top: -5px; color: #7c92a4; font-size: 11px; font-weight: 400; }
#segmentPropertiesDialog .form-grid input:disabled { color: #2a5d83; background: #f3f8fc; font-weight: 700; }
#segmentPropertiesDialog .segment-section-hint { margin: 0; color: #73899c; font-size: 11px; line-height: 1.55; }
#segmentPropertiesDialog .segment-scheme-field > span { display: flex; align-items: baseline; gap: 7px; }
#segmentPropertiesDialog .segment-scheme-field > span small { margin: 0; color: #8396a7; font-size: 10px; font-weight: 400; }
#segmentPropertiesDialog .check-row { gap: 8px; min-height: 38px; padding-top: 11px; }
#segmentPropertiesDialog .check-row input { width: auto; height: auto; }
#segmentPropertiesDialog #segmentPropertiesNote { flex: 0 0 auto; margin: 0; padding: 11px 24px; border-top: 1px solid #e5edf3; background: #fff; }
#itemPropertiesDialog { width: min(1100px, calc(100vw - 40px)); max-width: none; max-height: min(900px, calc(100vh - 36px)); padding: 0; border: 1px solid #bfd0de; border-radius: 11px; background: #fff; }
#itemPropertiesDialog::backdrop { background: rgba(39, 60, 79, .18); backdrop-filter: none; }
#itemPropertiesDialog .dialog-head { flex: 0 0 auto; padding: 18px 24px 14px; background: linear-gradient(90deg, #fff, #f7fbfe); }
#itemPropertiesDialog .dialog-head h3 { font-size: 22px; }
#itemPropertiesDialog .dialog-head p:last-child { margin: 7px 0 0; color: #607b91; font-size: 13px; }
#itemPropertiesDialog .segment-properties-body { min-height: 0; overflow: auto; padding: 0; }
#itemPropertiesDialog .segment-properties-body section { padding: 13px 24px 4px; border-bottom: 1px solid #e5edf3; }
#itemPropertiesDialog .segment-properties-body h4 { margin: 0 0 4px; color: #275572; font-size: 14px; }
#itemPropertiesDialog .item-property-section-hint { margin: 0; color: #73899c; font-size: 11px; line-height: 1.55; }
#itemPropertiesDialog .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; padding: 10px 0 2px; }
#itemPropertiesDialog .long-property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#itemPropertiesDialog .form-grid label { min-width: 0; margin-bottom: 12px; }
#itemPropertiesDialog .form-grid .span2 { grid-column: span 2; }
#itemPropertiesDialog .form-grid input, #itemPropertiesDialog .form-grid select, #itemPropertiesDialog .form-grid textarea { width: 100%; min-width: 0; padding: 7px 10px; }
#itemPropertiesDialog .form-grid input, #itemPropertiesDialog .form-grid select { height: 38px; }
#itemPropertiesDialog .form-grid textarea { min-height: 58px; resize: vertical; line-height: 1.45; }
#itemPropertiesDialog .form-grid input:disabled { color: #2a5d83; background: #f3f8fc; font-weight: 700; }
#itemPropertiesDialog .check-row { min-height: 38px; padding-top: 11px; align-items: center; gap: 8px; }
#itemPropertiesDialog .check-row input { width: auto; height: auto; }
.segment-properties-form .dialog-actions { flex: 0 0 auto; align-items: center; min-height: 66px; padding: 12px 24px; background: #fbfdff; }
.segment-plan-value { display: flex; min-width: 0; align-items: center; gap: 6px; }
.segment-plan-value select { min-width: 0; flex: 1; }
.segment-plan-value .tiny { flex: 0 0 auto; min-height: 38px; padding: 5px 10px; }
.dialog-actions-spacer { flex: 1; }
@media (max-width: 760px) {
  .other-fee-formula-dialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); }
  .other-fee-formula-dialog .dialog-head,.other-fee-formula-body section { padding-left: 14px; padding-right: 14px; }
  .other-fee-formula-grid,.management-fee-preview { grid-template-columns: 1fr; }
  .other-fee-formula-grid .span2 { grid-column: auto; }
  #segmentPropertiesDialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); }
  #itemPropertiesDialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  #segmentPropertiesDialog .dialog-head, #segmentPropertiesDialog .segment-properties-body section, #itemPropertiesDialog .dialog-head, #itemPropertiesDialog .segment-properties-body section { padding-left: 14px; padding-right: 14px; }
  #segmentPropertiesDialog .form-grid, #itemPropertiesDialog .form-grid { grid-template-columns: 1fr; }
  #segmentPropertiesDialog .form-grid .span2, #itemPropertiesDialog .form-grid .span2 { grid-column: auto; }
  .segment-properties-form .dialog-actions { min-height: 0; padding: 10px 14px; flex-wrap: wrap; }
  .dialog-actions-spacer { display: none; }
}
.segment-switcher { display: inline-flex; min-width: 0; max-width: 260px; align-items: center; gap: 4px; color: #527089; font-size: 11px; }
.segment-switcher select { min-width: 0; max-width: 210px; height: 27px; padding: 3px 24px 3px 7px; border: 1px solid #b9cad9; border-radius: 5px; background: #fff; color: #244866; font-size: 11px; font-weight: 700; }
.workspace-segment-button { height: 27px; flex: 0 0 auto; padding: 0 8px; border: 1px solid #a9c2d6; border-radius: 5px; background: #fff; color: #1f5f91; font-size: 11px; font-weight: 700; white-space: nowrap; }
.workspace-segment-button:hover { border-color: #6fa3ca; background: #edf6fd; }
.workspace-segment-button.danger { color: #b33a3a; border-color: #deb6b6; }
.workspace-segment-button.danger:hover { border-color: #cc7777; background: #fff3f3; }
.workspace-segment-button:disabled { cursor: not-allowed; opacity: .48; background: #f4f7f9; }
.segment-delete-dialog .segment-delete-close, .item-delete-dialog .segment-delete-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #718699; font-size: 24px; }
.segment-delete-dialog .segment-delete-close:hover, .item-delete-dialog .segment-delete-close:hover { background: #eaf1f6; }
.segment-delete-dialog .scheme-delete-usage { display: grid; }
.segment-delete-dialog .scheme-delete-body p.error { color: #b43f38; font-weight: 700; }
.item-delete-dialog .scheme-delete-body p.error { color: #b43f38; font-weight: 700; }
.locked-note { margin: 9px 10px 11px; padding: 8px; border-radius: 6px; background: #fff7e9; color: #805419; font-size: 11px; line-height: 1.5; }
.property-edit { margin: 10px; border: 1px solid #b9cad9; border-radius: 6px; padding: 8px; background: #f7fafc; color: #2f5878; font-weight: 700; }
@media (max-width: 1200px) {
  .workbench-v2 { grid-template-columns: minmax(230px, 24%) 1fr; }
  .property-pane { display: none; }
}

/* Compact desktop workbench requested for the estimating workflow. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.workspace-titlebar { min-height: 42px !important; padding: 4px 10px !important; gap: 8px; }
.workspace-titlebar .icon-button { width: 31px; height: 31px; margin-right: 2px !important; }
.workspace-title-line { min-width: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.workspace-title-line h2 { max-width: min(34vw, 460px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-refresh-button { width: 27px; height: 27px; flex: 0 0 27px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #bfd0df; border-radius: 6px; background: #fff; color: #286b9f; font-size: 18px; line-height: 1; }
.workspace-refresh-button:hover { background: #edf6fd; border-color: #8fb6d6; }
.workspace-refresh-button:disabled { cursor: wait; opacity: .65; }
.workspace-refresh-button.refreshing span { display: inline-block; animation: workspace-refresh-spin .75s linear infinite; }
@keyframes workspace-refresh-spin { to { transform: rotate(360deg); } }

.workspace-open-progress {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: #17324d;
  background: #fff;
  box-shadow: 0 22px 64px rgba(17, 45, 75, .28);
}
.workspace-open-progress::backdrop { background: rgba(25, 47, 70, .36); backdrop-filter: blur(2px); }
.workspace-open-progress-head { display: flex; align-items: center; gap: 16px; padding: 24px 26px 18px; }
.workspace-open-progress-head > div { min-width: 0; }
.workspace-open-progress-head small { display: block; margin-bottom: 4px; color: #6c8195; letter-spacing: .08em; }
.workspace-open-progress-head strong { display: block; overflow: hidden; color: #133b62; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-open-progress-head p { margin: 7px 0 0; color: #60758a; }
.workspace-open-spinner { width: 34px; height: 34px; flex: 0 0 34px; border: 3px solid #d9e8f6; border-top-color: #1673c9; border-radius: 50%; animation: workspace-open-spin .8s linear infinite; }
.workspace-open-progress progress { display: block; width: calc(100% - 52px); height: 7px; margin: 0 26px 18px; overflow: hidden; border: 0; border-radius: 8px; accent-color: #1673c9; }
.workspace-open-progress-meta { display: flex; justify-content: space-between; padding: 13px 26px; border-top: 1px solid #e8f0f7; color: #6c8195; background: #f7fafc; font-size: 12px; }
@keyframes workspace-open-spin { to { transform: rotate(360deg); } }
.workspace-meta-inline { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.workspace-actions { margin-left: auto; flex-wrap: nowrap; white-space: nowrap; }
.workspace-actions button { padding: 6px 9px; }
.ribbon { min-height: 52px !important; height: 52px !important; padding: 3px 8px !important; gap: 2px !important; }
.ribbon button { width: 54px !important; min-width: 54px !important; height: 45px; padding: 3px 5px !important; display: inline-flex !important; flex-direction: column !important; justify-content: center; align-items: center; gap: 2px; white-space: nowrap; }
.ribbon button b { margin: 0 !important; font-size: 17px !important; line-height: 1; }
.ribbon button span { white-space: nowrap; font-size: 11px; line-height: 1.1; }
.ribbon .toggle-label { white-space: nowrap; }
.panel-switches { display: flex; align-items: center; gap: 9px; padding: 0 8px; }
.panel-switches label { display: flex; align-items: center; gap: 5px; color: #4e6579; font-size: 12px; white-space: nowrap; cursor: pointer; }
.panel-switches input { width: 28px; height: 15px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.workbench-v2 { --tree-width: 290px; --property-width: 300px; grid-template-columns: var(--tree-width) 5px minmax(520px, 1fr) 5px var(--property-width); gap: 0; }
.workbench-v2.hide-property { grid-template-columns: var(--tree-width) 5px minmax(520px, 1fr); }
.workbench-v2.hide-property > .property-pane, .workbench-v2.hide-property > #propertyResizeHandle, .workbench-v2.hide-property > #previewPropertyResize { display: none; }
.workbench-v2.hide-center { grid-template-columns: minmax(520px, 1fr) 5px var(--property-width); }
.workbench-v2.hide-center > .workspace-center, .workbench-v2.hide-center > #treeResizeHandle, .workbench-v2.hide-center > #previewTreeResize { display: none; }
.workbench-v2.hide-center.hide-property { grid-template-columns: minmax(0, 1fr); }
.workbench-v2.hide-center.hide-property > #propertyResizeHandle, .workbench-v2.hide-center.hide-property > #previewPropertyResize { display: none; }
.pane-splitter { position: relative; cursor: col-resize; background: #d2dce5; touch-action: none; }
.pane-splitter::after { content: ""; position: absolute; inset: 0 -3px; }
.pane-splitter:hover, .pane-splitter.dragging { background: #5b9bd5; }
.pane-splitter.dragging { z-index: 30; will-change: transform; box-shadow: 0 0 0 1px rgba(91,155,213,.2); }
body.pane-resizing { cursor: col-resize; user-select: none; }
.horizontal-splitter { position: relative; min-height: 5px; cursor: row-resize; background: #d2dce5; touch-action: none; }
.horizontal-splitter::after { content: ""; position: absolute; inset: -3px 0; }
.horizontal-splitter:hover, .horizontal-splitter.dragging { background: #5b9bd5; }
.compilation-head { padding-right: 3px !important; }
.workflow-tabs { height: 100%; display: flex; align-items: center; }
.workflow-tabs i { width: 1px; height: 22px; margin: 0 5px; background: #cbd6e0; }
.workflow-tabs button, .quota-source-tabs button, .quota-toolbar select { white-space: nowrap; font-size: 13px; }
.auto-calculate-control { min-width: 104px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #b9c7d7; border-radius: 7px; background: #fff; color: #31516f; font-size: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.auto-calculate-control input { position: absolute; opacity: 0; pointer-events: none; }
.auto-calculate-control i { position: relative; width: 30px; height: 16px; flex: 0 0 30px; border-radius: 999px; background: #bac6d1; transition: background .18s ease; }
.auto-calculate-control i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(32,55,81,.35); transition: transform .18s ease; }
.auto-calculate-control input:checked + i { background: var(--blue); }
.auto-calculate-control input:checked + i::after { transform: translateX(14px); }
.auto-calculate-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(23,107,193,.12); }
.quota-source-tabs .context-tab { color: #315f84; }
.tree-pane-head { min-height: 30px; height: 30px; flex-basis: 30px; padding: 3px 4px !important; justify-content: flex-start; gap: 4px; white-space: nowrap; overflow: visible; }
.tree-pane-head > strong { flex: 0 0 auto; white-space: nowrap; font-size: 12px; }
.tree-pane-head > .tree-head-actions { margin-left: auto; display: flex; align-items: center; flex: 0 0 auto; gap: 2px; }
.tree-head-actions button { width: 20px; min-width: 20px; height: 21px; padding: 0; border: 1px solid #c7d3de; border-radius: 3px; background: #fff; color: #46657e; font-size: 11px; line-height: 19px; }
.tree-head-actions button.active { border-color: #78acd2; background: #e5f2fb; color: #126da9; }
.tree-head-actions button.refreshing { animation: workspace-refresh-spin .75s linear infinite; }
.column-chooser { position: relative; }
.tree-pane-head .column-chooser { flex: 0 0 20px; }
.tree-pane-head .column-chooser summary { width: 20px; height: 21px; display: grid; place-items: center; border: 1px solid #c7d3de; border-radius: 3px; background: #fff; color: #46657e; font-size: 10px; cursor: pointer; list-style: none; }
.column-chooser summary::-webkit-details-marker { display: none; }
.column-menu { position: absolute; z-index: 20; top: 29px; right: 0; width: 190px; padding: 10px; display: grid; gap: 6px; border: 1px solid #bdcbd8; border-radius: 7px; background: #fff; box-shadow: 0 8px 24px rgba(32,55,81,.18); }
.column-menu > strong { margin-bottom: 2px; color: #334d63; font-size: 12px; }
.column-menu label { display: flex; align-items: center; gap: 7px; color: #4a6073; font-size: 11px; cursor: pointer; }
.column-menu label input { margin: 0; accent-color: var(--blue); }
.column-menu > div { display: flex; gap: 6px; padding-top: 4px; }
.column-menu button { width: auto; flex: 1; }
.column-menu small { color: #8492a3; font-size: 10px; }
.tree-bottom-tools { display: flex; gap: 3px; padding: 5px 7px; border-top: 1px solid var(--line2); background: #f7f9fb; }
.tree-bottom-tools button { border: 0; border-radius: 4px; padding: 4px 8px; background: transparent; color: #5c6e7d; font-size: 11px; }
.tree-bottom-tools button.active { background: #e5f1fb; color: #0e5aa7; font-weight: 700; }
.tree-table { table-layout: auto; }
.tree-table td { height: 29px; padding: 4px 7px !important; border-bottom: 1px solid #e7edf2; }
.directory-grid { width: max-content; min-width: 100%; }
.directory-grid th, .directory-grid td { font-size: 12px; }
.directory-grid [data-col="row"] { width: 48px; min-width: 48px; text-align: center; }
.directory-grid [data-col="code"] { width: 115px; min-width: 115px; }
.directory-grid [data-col="chapter"] { width: 58px; min-width: 58px; text-align: center; }
.directory-grid [data-col="name"] { width: 360px; min-width: 220px; }
.directory-grid [data-col="unit"] { width: 82px; min-width: 82px; text-align: center; }
.directory-grid [data-col="quantity"], .directory-grid [data-col="cumulative"] { width: 92px; min-width: 92px; }
.directory-editable { position: relative; cursor: text; }
.directory-quantity-input { position: absolute; inset: 1px 2px; display: block; width: auto; min-width: 0; max-width: none; height: auto; box-sizing: border-box; margin: 0; padding: 1px 5px; border: 1px solid #1976d2; border-radius: 2px; outline: none; background: #fff; color: #17324d; box-shadow: inset 0 0 0 1px rgba(25,118,210,.06); font: inherit; line-height: 1; text-align: right; }
.directory-quantity-input:focus { box-shadow: inset 0 0 0 1px rgba(25,118,210,.12); }
.directory-grid [data-col="total"], .directory-grid [data-col="indicator"] { width: 126px; min-width: 126px; }
.directory-grid [data-col="factor"] { width: 105px; min-width: 105px; }
.directory-grid .column-hidden { display: none; }
.directory-grid tbody [data-col="name"] { font-weight: 600; }
.mini-switch { display: inline-block; width: 24px; height: 12px; border-radius: 7px; background: #aab7c3; vertical-align: middle; }
.mini-switch.on::after { content: ""; display: block; width: 8px; height: 8px; margin: 2px; border-radius: 50%; background: #fff; }
.tree-table .tree-name { min-width: 0; padding-left: calc(var(--tree-depth, 0) * .55em); display: flex; align-items: center; gap: 4px; white-space: nowrap; line-height: 1.2; }
.tree-table .tree-name > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree-toggle { width: 11px; flex: 0 0 11px; border: 0; padding: 0; background: transparent; color: #59738a; font-size: 9px; cursor: pointer; }
.tree-toggle.placeholder { visibility: visible; cursor: default; color: #8192a0; }
.tree-toggle.placeholder.single-marker { color: #278268; }
.tree-kind-icon { display: none; }
.tree-kind-icon.single-project { color: #278268; }
.project-tree-pane .pane-footer { min-height: 28px; padding: 5px 8px; }
@media (max-width: 1200px) {
  .workbench-v2 { grid-template-columns: minmax(220px, var(--tree-width)) 5px minmax(520px, 1fr); }
  #propertyResizeHandle, .property-pane { display: none; }
  .workspace-actions button:nth-child(2), .workspace-actions button:nth-child(4), .workspace-actions button:nth-child(5) { display: none; }
}
