
/* V215 border patch retained verbatim for the existing editor controls. */
#editorSidebarScroll .v09212-name-row input {border-radius:0;border:2px inset var(--v09201-border,#b8c6cf);}
#editorSidebarScroll .v09213-export-editor select {border-radius:0;border-color:var(--v09201-border,#b8c6cf);}
html[data-theme="light"] #editorSidebarScroll :is(.v09212-name-row input,.v09213-export-editor select) {border-color:#d2d8de;}
html[data-theme="dark"] #editorSidebarScroll .v09212-name-row input {border-color:#505054 !important;}

[data-editor-section="cost"] .editor-section-dot {background:#9c714e;}
#costPanel {
  --cost-value-font-size:17px;
  --cost-caption-font-size:12px;
  --cost-ink:var(--v09206-active-text,#192d38);
  --cost-muted:var(--v09201-secondary,#52616b);
  --cost-surface:var(--v09201-surface,#fff);
  --cost-soft:var(--v09201-surface-muted,#f3f5f7);
  --cost-line:var(--v09201-separator,#dce2e8);
  --cost-border:var(--v09201-border,#c7d0d8);
  --cost-accent:#167aa8;
  min-width:0;
  max-width:100%;
  color:var(--cost-ink);
  font-size:12px;
  font-variant-numeric:tabular-nums;
}
#costPanel .editor-section-body {
  min-width:0;
  overflow:hidden;
  padding:10px 10px 12px;
}
#costPanel .cost-totals {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  margin:0;
  padding:0 0 9px;
  border-bottom:1px solid var(--cost-line);
}
#costPanel .cost-totals > div {
  min-width:0;
  padding:0 9px;
  border-right:1px solid var(--cost-line);
}
#costPanel .cost-totals > div:first-child {padding-left:0;}
#costPanel .cost-totals > div:last-child {padding-right:0;border-right:0;}
#costPanel .cost-totals dt {
  margin:0 0 2px;
  color:var(--cost-muted);
  font-size:var(--cost-caption-font-size);
  line-height:1.35;
  white-space:nowrap;
}
#costPanel .cost-totals dd {
  min-width:0;
  margin:0;
  overflow:hidden;
  color:var(--cost-ink);
  font-size:var(--cost-value-font-size);
  font-weight:650;
  line-height:1.35;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#costPanel .cost-totals dd small {
  display:inline-block;
  margin-left:4px;
  color:#a24f05;
  font-size:10px;
  font-weight:600;
}
html[data-theme="dark"] #costPanel .cost-totals dd small {color:#ffca91;}

#costPanel .cost-missing {
  display:flex;
  min-height:28px;
  align-items:center;
  gap:5px;
  margin:8px 0 6px;
  padding:3px 6px;
  border-left:1px solid #b96c25;
  background:color-mix(in srgb,var(--cost-soft) 84%,#fff2df 16%);
  color:#7e3f08;
  line-height:1.35;
}
#costPanel .cost-missing[hidden] {display:none;}
html[data-theme="dark"] #costPanel .cost-missing {
  background:color-mix(in srgb,var(--cost-soft) 90%,#6e431f 10%);
  color:#ffd3a6;
}
#costPanel .cost-missing > span {font-weight:650;white-space:nowrap;}
#costPanel .cost-missing button {
  min-height:24px;
  border:0;
  border-bottom:1px solid currentColor;
  background:transparent;
  color:inherit;
  padding:1px 3px;
  line-height:1.2;
  cursor:pointer;
}
#costPanel .cost-table-meta {
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin:7px 0 4px;
  color:var(--cost-muted);
  font-size:11px;
  line-height:1.4;
}
#costPanel .cost-scroll-hint {
  margin:4px 0;
  color:var(--cost-muted);
  font-size:11px;
  line-height:1.35;
}
#costPanel .cost-scroll {
  width:100%;
  min-width:0;
  max-width:100%;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-color:#80909b var(--cost-soft);
  scrollbar-width:auto;
  box-sizing:border-box;
}
#costPanel .cost-scroll::-webkit-scrollbar {width:11px;height:11px;}
#costPanel .cost-scroll::-webkit-scrollbar-track {background:var(--cost-soft);}
#costPanel .cost-scroll::-webkit-scrollbar-thumb {
  border:2px solid var(--cost-soft);
  border-radius:8px;
  background:#80909b;
}
#costPanel .cost-scroll-top {
  height:14px;
  margin:0 0 3px;
  overflow-x:auto;
  overflow-y:hidden;
}
#costPanel .cost-scroll-top > div {height:1px;}
#costPanel #costTableScroll {
  max-height:min(60vh,720px);
  border:1px solid var(--cost-border);
  background:var(--cost-surface);
}
#costPanel table {
  width:100%;
  min-width:926px;
  table-layout:fixed;
  border:0;
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
  line-height:1.25;
}
#costPanel th:nth-child(3),#costPanel td:nth-child(3) {width:86px;}
#costPanel th:nth-child(4),#costPanel td:nth-child(4) {width:166px;}
#costPanel th:nth-child(5),#costPanel td:nth-child(5),
#costPanel th:nth-child(6),#costPanel td:nth-child(6) {width:72px;}
#costPanel th:nth-child(7),#costPanel td:nth-child(7) {width:88px;}
#costPanel th:nth-child(8),#costPanel td:nth-child(8) {width:94px;}
#costPanel th:nth-child(9),#costPanel td:nth-child(9) {width:98px;}
#costPanel th,
#costPanel td {
  height:32px;
  box-sizing:border-box;
  border:0;
  border-bottom:1px solid var(--cost-line);
  padding:2px 4px;
  text-align:right;
  vertical-align:middle;
  white-space:nowrap;
}
#costPanel thead th {
  position:sticky;
  top:0;
  z-index:3;
  height:32px;
  background:var(--cost-soft);
  color:var(--cost-ink);
  font-weight:650;
}
#costPanel th:first-child,
#costPanel td.cost-structure {
  position:sticky;
  left:0;
  width:150px;
  min-width:150px;
  max-width:150px;
  z-index:2;
  background:var(--cost-surface);
  text-align:left;
}
#costPanel th:nth-child(2),
#costPanel td.cost-material {
  position:sticky;
  left:var(--cost-first-width,150px);
  width:100px;
  min-width:100px;
  max-width:100px;
  z-index:2;
  overflow:hidden;
  background:var(--cost-surface);
  box-shadow:1px 0 0 var(--cost-border);
  text-align:left;
  text-overflow:ellipsis;
}
#costPanel thead th:first-child,
#costPanel thead th:nth-child(2) {
  z-index:5;
  background:var(--cost-soft);
}
#costPanel tbody tr:hover > td {background:color-mix(in srgb,var(--cost-surface) 92%,#cfeaf6 8%);}
#costPanel tbody tr.is-expanded > td {
  background:color-mix(in srgb,var(--cost-soft) 86%,#dcedf5 14%);
}
#costPanel tbody tr.is-expanded > td.cost-structure {
  border-left:1px solid var(--cost-accent);
}
#costPanel .cost-structure {
  overflow:hidden;
  padding-left:3px;
}
#costPanel .cost-structure > span {
  display:inline-block;
  width:calc(100% - 29px);
  overflow:hidden;
  margin-left:2px;
  text-overflow:ellipsis;
  vertical-align:middle;
  white-space:nowrap;
}
#costPanel .cost-disclosure {
  position:relative;
  width:24px;
  height:24px;
  min-width:24px;
  border:0;
  border-radius:4px;
  background:transparent;
  color:var(--cost-muted);
  padding:0;
  vertical-align:middle;
  cursor:pointer;
}
#costPanel .cost-disclosure::before {
  position:absolute;
  top:50%;
  left:50%;
  width:0;
  height:0;
  border-top:4px solid transparent;
  border-bottom:4px solid transparent;
  border-left:6px solid currentColor;
  content:"";
  transform:translate(-40%,-50%);
  transition:transform 160ms ease-out;
}
#costPanel .cost-disclosure[aria-expanded="true"]::before {
  transform:translate(-50%,-35%) rotate(90deg);
}
#costPanel .cost-disclosure:hover {background:color-mix(in srgb,var(--cost-soft) 82%,var(--cost-accent) 18%);color:var(--cost-accent);}
#costPanel .cost-spec {
  width:180px;
  max-width:220px;
  overflow:hidden;
  color:var(--cost-muted);
  text-overflow:ellipsis;
}
#costPanel .cost-number {white-space:nowrap;}
#costPanel .cost-number-input {
  width:100%;
  height:28px;
  min-width:0;
  box-sizing:border-box;
  border:2px inset var(--v09201-border,#b8c6cf);
  border-radius:0;
  background:var(--cost-soft);
  color:var(--cost-ink);
  padding:0 4px;
  text-align:right;
}
#costPanel .cost-not-applicable {color:var(--cost-muted);}
html[data-theme="light"] #editorSidebarScroll #costPanel .cost-number-input {border-color:#d2d8de;}
html[data-theme="dark"] #editorSidebarScroll #costPanel .cost-number-input {border-color:#505054;background:var(--v09201-surface-muted);color:var(--cost-ink);}
#costPanel input::placeholder {color:var(--cost-muted);opacity:1;}
#costPanel .cost-required {color:#9a4900;font-weight:650;}
html[data-theme="dark"] #costPanel .cost-required {color:#ffca91;}
#costPanel :is(input,select,button):focus-visible {
  outline:2px solid #1595d3;
  outline-offset:1px;
}
#costPanel .cost-detail-row > td {
  height:auto;
  padding:0;
  background:var(--cost-soft);
  text-align:left;
  white-space:normal;
}
#costPanel .cost-detail {
  position:sticky;
  left:0;
  width:min(var(--cost-viewport,720px),720px);
  max-width:100vw;
  box-sizing:border-box;
  border-left:1px solid var(--cost-accent);
  padding:8px 10px 8px 34px;
  color:var(--cost-muted);
}
#costPanel .cost-detail-fields {
  display:flex;
  align-items:end;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:6px;
}
#costPanel .cost-detail-fields label {
  display:grid;
  gap:3px;
  min-width:142px;
  color:var(--cost-muted);
  font-size:11px;
}
#costPanel .cost-detail-fields :is(input,select) {
  width:100%;
  height:28px;
  box-sizing:border-box;
  border:1px solid var(--cost-border);
  border-radius:5px;
  background:var(--cost-surface);
  color:var(--cost-ink);
  padding:2px 6px;
}
#costPanel .cost-detail p {
  margin:3px 0;
  overflow-wrap:anywhere;
  font-size:11px;
  line-height:1.5;
  white-space:normal;
}
#costPanel .cost-detail h4 {
  margin:0 0 6px;
  color:var(--cost-ink);
  font-size:12px;
  font-weight:650;
  line-height:1.4;
}
#costPanel .cost-detail h4 span {
  margin-left:6px;
  color:var(--cost-muted);
  font-size:11px;
  font-weight:400;
}
#costPanel .cost-detail-notes {margin-top:5px;}
#costPanel .cost-detail-notes summary {
  width:max-content;
  color:var(--cost-muted);
  cursor:pointer;
  font-size:11px;
}
#costPanel .cost-detail b {color:var(--cost-ink);font-weight:650;}
#costPanel .cost-empty {
  height:auto;
  padding:18px 10px;
  text-align:left;
  white-space:normal;
}
#costPanel .cost-status {
  margin:7px 0 0;
  color:var(--cost-muted);
  font-size:11px;
  line-height:1.45;
}
#costPanel .cost-status[hidden] {display:none;}
#costPanel .cost-warn {color:#9a4900 !important;}
html[data-theme="dark"] #costPanel .cost-warn {color:#ffca91 !important;}
#costPanel .cost-actions {
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:8px;
}
#costPanel .cost-actions button {
  min-height:30px;
  border:1px solid var(--cost-border);
  border-radius:5px;
  background:var(--cost-surface);
  color:var(--cost-ink);
  padding:4px 8px;
  cursor:pointer;
}
#costPanel .cost-actions button:first-child {
  border-color:var(--cost-accent);
  background:var(--cost-accent);
  color:#fff;
}
#costPanel .cost-actions button:hover {filter:brightness(.97);}
#costPanel .cost-summary {
  margin-top:8px;
  border-top:1px solid var(--cost-line);
  padding-top:6px;
}
#costPanel .cost-summary > summary {
  width:max-content;
  color:var(--cost-muted);
  cursor:pointer;
  font-size:11px;
  line-height:1.4;
}
#costPanel .cost-summary-list {
  margin:5px 0 0;
  padding:0;
  list-style:none;
}
#costPanel .cost-summary-list li {
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:3px 0;
  color:var(--cost-muted);
  font-size:11px;
  line-height:1.4;
}
#costPanel .cost-summary-list b {
  overflow:hidden;
  color:var(--cost-ink);
  font-weight:600;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#costPanel .cost-summary-list span {text-align:right;white-space:nowrap;}
#costPanel .cost-footnote {
  margin:7px 0 0;
  color:var(--cost-muted);
  font-size:11px;
  line-height:1.45;
}
html #editorSidebarScroll #costPanel .editor-section-body :is(input,select,label,output,button) {font-size:12px !important;}

.v218-conductor-params {
  margin:6px 0;
  padding:0;
  border-top:0;
}
.v218-conductor-params .v218-param {
  display:grid;
  grid-template-columns:132px minmax(0,1fr);
  gap:8px;
  align-items:center;
  margin:0 0 4px;
  padding-left:26px;
}
.v218-conductor-params :is(input,select) {
  width:100%;
  min-width:0;
  height:32px;
  box-sizing:border-box;
  border:1px solid var(--v09201-border,#d2d8de);
  border-radius:6px;
  background:var(--v09201-surface,#fff);
  color:var(--v09206-active-text,#111);
  font:inherit;
  padding:3px 8px;
}
.v218-conductor-params :is(input,select):disabled {
  background:var(--v09201-surface-muted,#f1f3f5);
  color:var(--v09201-secondary,#52616b);
  opacity:1;
}
.v218-conductor-params .v218-note {
  padding-left:26px;
  color:var(--v09201-secondary,#52616b);
  font-size:11px;
  line-height:1.45;
}

#editorSidebarScroll .v09186-conductor-role-title {
  font-size:var(--structure-field-font-size,13px);
}
#editorSidebarScroll .v09186-conductor-role-title::after {content:none;}
#editorSidebarScroll #auxiliaryConductorControls {
  margin-top:10px;
  padding-top:4px;
  border-top:1px dashed var(--v09201-separator,#dce2e8);
}

@media (max-width:860px) {
  #costPanel {--cost-value-font-size:15px;--cost-caption-font-size:11px;}
  #costPanel .editor-section-body {padding-right:8px;padding-left:8px;}
  #costPanel .cost-totals > div {padding-right:5px;padding-left:5px;}
  #costPanel .cost-totals dt {font-size:var(--cost-caption-font-size);}
  #costPanel .cost-totals dd {font-size:var(--cost-value-font-size);}
  #costPanel .cost-missing {min-height:28px;flex-wrap:wrap;}
  #costPanel #costTableScroll {max-height:58vh;}
  #costPanel th:first-child,
  #costPanel td.cost-structure {
    width:138px;
    min-width:138px;
    max-width:138px;
  }
  #costPanel th:nth-child(2) {left:auto;z-index:3;}
  #costPanel td.cost-material {
    position:static;
    width:100px;
    min-width:100px;
    max-width:100px;
  }
  #costPanel .cost-detail {padding-left:22px;}
  .v218-conductor-params .v218-param {grid-template-columns:124px minmax(0,1fr);}
}

/* V221: concise costs and per-opening global rates. */
#costPanel .cost-totals {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 0;}
#costPanel .cost-totals > div:nth-child(odd) {padding-left:0;}
#costPanel .cost-totals > div:nth-child(even) {padding-right:0;border-right:0;}
#costPanel .cost-rates {display:flex;gap:12px;flex-wrap:wrap;margin:9px 0;}
#costPanel .cost-rates label {display:flex;align-items:center;gap:5px;}
#costPanel .cost-rates input {width:75px;min-width:0;height:28px;box-sizing:border-box;background:var(--cost-surface);color:var(--cost-ink);border:1px solid var(--cost-border);padding:2px 5px;}
#costPanel .cost-rates input:invalid {outline:1px solid #de5a32;}
#costPanel .cost-more {display:flex;align-self:center;}
#costPanel .cost-more summary {cursor:pointer;padding:6px;}
#costPanel .cost-more button {margin:4px;}
#costPanel .cost-summary-table {width:100%;min-width:0;table-layout:auto;margin-top:6px;}
#costPanel .cost-summary-table :is(th,td) {position:static;width:auto;min-width:0;max-width:none;height:30px;font-size:12px;padding:3px 4px;box-shadow:none;}
#costPanel .cost-summary-table :is(th,td):first-child {text-align:left;white-space:normal;}
#costPanel .cost-summary-table :is(th,td):nth-child(n+2) {text-align:right;}
#costPanel .cost-required,#costPanel .cost-warn,#costPanel .cost-missing,#costPanel .cost-totals dd small {color:#c44921 !important;}
html[data-theme="dark"] #costPanel :is(.cost-required,.cost-warn,.cost-missing),html[data-theme="dark"] #costPanel .cost-totals dd small {color:#ff9167 !important;}
/* Explicit V221 approval: main and auxiliary conductor selectors share 32px. */
#editorSidebarScroll :is(#conductorMaterial,#conductorSurface,#conductorClass,#conductorLayers,#auxiliaryConductorMaterial,#auxiliaryConductorSurface,#auxiliaryConductorClass,#auxiliaryConductorLayers) {height:32px !important;min-height:32px !important;}

/* V221 approved unified editor controls: one geometry on desktop and mobile. */
html #editorSidebarScroll :is([data-editor-section="structure"],[data-editor-section="common"],[data-editor-section="core"],[data-editor-section="group"],[data-editor-section="outer"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),select) {
  height:32px !important;
  min-height:32px !important;
  max-height:32px !important;
  box-sizing:border-box !important;
  font-size:var(--structure-field-font-size,13px) !important;
  line-height:normal !important;
  padding:2px 6px !important;
}
html #editorSidebarScroll :is([data-editor-section="structure"],[data-editor-section="common"],[data-editor-section="core"],[data-editor-section="group"],[data-editor-section="outer"]) select:not(#v221-unused-control) {
  padding-right:24px !important;
}

/* V222: one visible horizontal control, independent of native overlay scrollbars. */
#costPanel .cost-scroll {scrollbar-width:auto;}
#costPanel .cost-scroll::-webkit-scrollbar {width:11px;height:11px;}
#costPanel .cost-horizontal-bar {height:28px;position:relative;margin:2px 0 4px;touch-action:none;cursor:pointer;user-select:none;}
#costPanel .cost-horizontal-bar[hidden] {display:none;}
#costPanel .cost-horizontal-bar::before {content:'';position:absolute;left:0;right:0;top:9px;height:10px;border-radius:5px;background:var(--cost-soft);border:1px solid var(--cost-border);box-sizing:border-box;}
#costPanel .cost-horizontal-thumb {position:absolute;left:0;top:6px;height:16px;min-width:40px;border-radius:5px;background:#728591;cursor:grab;}
#costPanel .cost-horizontal-bar:active .cost-horizontal-thumb {cursor:grabbing;background:var(--cost-accent);}
#costPanel .cost-horizontal-bar:focus-visible {outline:2px solid var(--cost-accent);outline-offset:1px;}
html[data-theme="dark"] #costPanel .cost-horizontal-thumb {background:#a5b3bd;}
html #editorSidebarScroll #costPanel :is(.cost-number-input,.cost-detail-fields input,.cost-detail-fields select,.cost-rates input) {height:28px;min-height:28px;max-height:28px;box-sizing:border-box;}

/* V223: the structure column alone stays fixed. Keep table stacking local. */
#costPanel #costTableScroll {isolation:isolate;}
#costPanel #costTableScroll td.cost-material {position:static;z-index:auto;}
#costPanel #costTableScroll thead th:nth-child(2) {left:auto;z-index:3;}
#costPanel #costTableScroll td.cost-structure {z-index:4;}
#costPanel #costTableScroll thead th:first-child {z-index:6;}
@media (min-width:861px) {
  #costPanel .cost-horizontal-bar {display:none;}
}
@media (max-width:860px) {
  #costPanel #costTableScroll {scrollbar-color:auto;}
  #costPanel #costTableScroll::-webkit-scrollbar {height:0;width:11px;}
}

/* V224: required placeholders share the warning palette in both themes. */
html #editorSidebarScroll input:is([placeholder^="待填"],[placeholder^="必填"],[placeholder^="计算必填"])::placeholder {
  color:#c44921 !important;
  opacity:1;
}
html[data-theme="dark"] #editorSidebarScroll input:is([placeholder^="待填"],[placeholder^="必填"],[placeholder^="计算必填"])::placeholder {
  color:#ff9167 !important;
}
html #editorSidebarScroll .v09212-name-row input {
  height:28px !important;min-height:28px !important;max-height:28px !important;
  box-sizing:border-box;
}
html #editorSidebarScroll .v222-width-setting-row > .v223-manual-width-value {
  border:0;
  outline:1px dashed transparent;
  font:inherit;
  font-variant-numeric:tabular-nums;
  border-radius:4px;
  background:transparent;
  color:inherit;
  height:24px !important;min-height:24px !important;max-height:24px !important;
  box-sizing:border-box;
}
html[data-theme="dark"] #editorSidebarScroll .v222-width-setting-row > .v223-manual-width-value {
  border-color:#505054;
  background:var(--v09201-surface-muted);
  color:var(--v09206-active-text,#eef2f5);
}
html #editorSidebarScroll .v222-width-setting-row > .v223-manual-width-value:focus-visible {
  outline:1px dashed #1595d3;box-shadow:none;
}
#costPanel .cost-totals dt {white-space:normal;overflow-wrap:anywhere;}

html #materialAnnotationMissing {color:#c44921!important;}
html[data-theme='dark'] #materialAnnotationMissing {color:#ff9167!important;}

  
html[data-theme] #editorSidebarScroll .v222-width-setting-row > span.v223-manual-width-value {display:inline-block;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;padding:0!important;border:0!important;border-radius:4px;outline:1px dashed transparent;text-align:right;font:inherit;font-variant-numeric:tabular-nums;line-height:inherit;background:transparent;color:inherit;cursor:text;}
html[data-theme] #editorSidebarScroll .v222-width-setting-row > span.v223-manual-width-value:focus {outline-color:#1595d3;background:#fff;color:#1595d3;}
#costGeneratedModel {font-size:calc(var(--cost-value-font-size) + 2px);font-weight:650;line-height:1.35;margin:0 0 10px;overflow-wrap:anywhere;}
#costGeneratedModel[hidden] {display:none;}
html[data-theme] #editorSidebarScroll #costGeneratedModel .cost-model-adjusted {display:inline-block;margin-left:16px;font-size:var(--cost-caption-font-size);font-weight:400;line-height:1.35;color:var(--cost-muted)!important;white-space:nowrap;}

html[data-theme] #editorSidebarScroll #costGeneratedModel {color:var(--cost-ink)!important;}
html[data-theme] #editorSidebarScroll #costModelText {display:inline-block;min-width:12ch;max-width:100%;border:0;background:transparent!important;color:var(--cost-ink)!important;font-size:calc(var(--cost-value-font-size) + 2px)!important;font-weight:650;outline:none;cursor:text;white-space:pre-wrap;overflow-wrap:anywhere;}
html[data-theme] #editorSidebarScroll #costModelText:focus {box-shadow:0 1px 0 #1595d3;}
#costModelText:empty::before {content:attr(data-placeholder);color:var(--cost-muted);font-weight:400;}
