/* A working commercial page: compact rows, distinct editable/calculated cells. */
.commercial593-workspace,.commercial593-history,.commercial593-readonly{--c593-paper:var(--ui67-paper,#fff);--c593-bg:var(--ui67-canvas,#f4f7fa);--c593-ink:var(--ui67-ink,#173245);--c593-muted:var(--ui67-muted,#526b7c);--c593-line:var(--ui67-line,#d5e1e8);--c593-action:var(--ui67-action,#096b7b);--c593-soft:var(--ui67-action-soft,#edf7f8);--c593-warn:var(--ui67-warn,#82520a);--c593-warn-bg:var(--ui67-warn-soft,#fff6e6);--c593-danger:var(--ui67-danger,#aa3545);color:var(--c593-ink);min-width:0;max-width:100%}
.commercial593-workspace{padding:18px;border-radius:12px;background:var(--c593-paper);border-color:var(--c593-line);box-shadow:none}
.commercial593-workspace .c561-hero{align-items:flex-start;margin-bottom:12px;gap:18px}
.commercial593-workspace .c561-hero h2{font-size:22px;line-height:1.3;margin:5px 0 6px}
.commercial593-workspace .c561-hero p{font-size:12px;max-width:680px;line-height:1.5;color:var(--c593-muted);margin:0}
.commercial593-heading-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end;flex-wrap:wrap;max-width:410px}
.commercial593-heading-actions .btn{font-size:11px;min-height:34px;padding:7px 11px}
.commercial593-status{display:inline-flex;align-items:center;min-height:32px;padding:7px 11px;background:var(--c593-soft);border:1px solid var(--c593-line);border-radius:18px;font-size:11px;line-height:1.3;font-weight:650;color:var(--c593-action)}
.commercial593-status.is-dirty{background:var(--c593-warn-bg);color:var(--c593-warn)}
.commercial593-links{gap:7px;margin:8px 0}
.commercial593-links .btn{min-height:32px;font-size:11px;padding:6px 9px}
.commercial593-links .c561-status{padding:6px 10px;font-size:11px}
.commercial593-reference,.commercial593-caption{font-size:11px;color:var(--c593-muted);line-height:1.5;margin:7px 0}
.commercial593-filters{display:grid;grid-template-columns:minmax(180px,2fr) minmax(120px,1fr) minmax(150px,1fr) auto;gap:10px;align-items:end;padding:11px 12px;margin-top:14px;border:1px solid var(--c593-line);border-radius:8px;background:var(--c593-bg)}
.commercial593-filters label{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:550;color:var(--c593-muted);min-width:0}
.commercial593-filters input,.commercial593-filters select{min-height:34px;width:100%;font-size:12px;background:var(--c593-paper);color:var(--c593-ink);border-color:var(--c593-line)}
.commercial593-filters .btn{min-height:34px;font-size:11px;padding:6px 10px}
.commercial593-notice{padding:9px 12px;font-size:12px;line-height:1.5;border:1px solid var(--c593-line);border-left:3px solid var(--c593-action);border-radius:6px;background:var(--c593-soft);color:var(--c593-ink)}
#commercial593-editor{min-width:0;max-width:100%}
#commercial593-form{margin:0}
#commercial593-editor[data-view=editor]>.commercial593-panel-title{display:none}
.commercial593-panel-title{font-size:18px;margin:20px 0 8px}
#commercial593-editor .b574-commercial-meta{margin:10px 0;padding:8px 12px;border:1px solid var(--c593-line);border-radius:8px;background:var(--c593-bg);font-size:12px;color:var(--c593-muted)}
#commercial593-editor .b574-commercial-meta>summary{cursor:pointer;font-size:11px;font-weight:600}
#commercial593-editor .b574-commercial-meta .c561-fields{grid-template-columns:minmax(200px,2fr) minmax(170px,1.5fr) minmax(150px,1fr);gap:10px;margin:10px 0 0}
#commercial593-editor .b574-commercial-meta .c561-fields>label:first-child{grid-column:auto}
#commercial593-editor .c561-fields input,#commercial593-editor .c561-fields select,#commercial593-editor .c561-fields textarea{font-size:13px;min-height:36px;background:var(--c593-paper);color:var(--c593-ink);border-color:var(--c593-line)}
#commercial593-editor .b574-commercial-meta textarea{min-height:54px}
#commercial593-editor .b575-summary{position:relative;top:auto;margin-bottom:8px}
#commercial593-editor .b575-summary>div{height:78px;min-height:78px;padding:8px 10px}
#commercial593-editor .b575-summary strong{font-size:18px}
#commercial593-editor .c561-actions{gap:7px;margin:10px 0;align-items:center}
#commercial593-editor .c561-actions .btn{font-size:11px;min-height:34px;padding:6px 10px}
#commercial593-editor .b575-caption{font-size:11px;line-height:1.5}
#commercial593-editor .b575-scroll{max-height:66dvh;min-height:160px;max-width:100%;overflow:auto}
#commercial593-editor .b575-table{min-width:1255px;font-size:11px}
.commercial593-readonly .b575-table{min-width:1255px}
#commercial593-editor .b575-table .b575-name{width:235px}
#commercial593-editor .b575-table .b575-group{width:105px}
#commercial593-editor .b575-table .b575-detail-col{width:92px}
#commercial593-editor .b575-table .b575-quantity{width:85px}
#commercial593-editor .b575-table .b575-bands th:nth-last-child(2){width:190px}
#commercial593-editor .b575-table .b575-name>.btn{font-size:11px!important;line-height:1.35!important;color:var(--c593-action)}
#commercial593-editor .b575-table .b575-name>small{display:block;position:static;box-shadow:none;padding:3px 0 0;background:transparent;color:var(--c593-muted);font-size:9px;line-height:1.3}
#commercial593-editor .b575-table textarea[data-c561-inline=group]{width:100%;min-width:0;height:32px;min-height:32px;max-height:82px;resize:vertical;font-family:inherit;font-size:10px;line-height:1.4;padding:4px 5px;border:1px solid transparent;overflow-wrap:anywhere}
#commercial593-editor .b575-table input,#commercial593-editor .b575-table select{height:30px;min-height:30px!important;font-size:11px!important;border-radius:4px;background:var(--ui593-input,var(--c593-paper));border-color:var(--c593-line)!important}
#commercial593-editor .b575-table tfoot [data-b575-total]{overflow:visible!important;text-overflow:clip!important;font-size:10px!important;line-height:1.4}
#commercial593-editor .b575-table .b575-calculated{background:var(--ui593-calculated,var(--c593-bg));font-variant-numeric:tabular-nums}
#commercial593-editor .commercial593-row-actions .btn{display:block;width:100%;padding:2px 5px;min-height:24px;line-height:1.2;font-size:10px;margin:2px 0;border:1px solid transparent;background:transparent;color:var(--c593-muted);text-align:center}
#commercial593-editor .commercial593-row-actions .btn:hover{background:var(--ui593-hover,var(--c593-soft));border-color:var(--c593-line)}
#commercial593-editor .commercial593-row-actions .commercial593-delete{color:var(--c593-danger)}
#commercial593-editor .c561-cost-choices{max-height:42dvh;background:var(--c593-paper);border-color:var(--c593-line)}
#commercial593-editor .c561-choice{border-color:var(--c593-line);padding:9px 3px}
#commercial593-editor .c561-choice small{color:var(--c593-muted);font-size:11px}
#commercial593-editor .c561-choice:hover{background:var(--ui593-hover,var(--c593-soft))}
#commercial593-editor .c561-choice:has(input:checked){background:var(--ui593-selected,var(--c593-soft));border-radius:5px}
#commercial593-editor .commercial593-error{color:var(--c593-danger);font-size:12px;line-height:1.5;border:1px solid currentColor;border-radius:6px;padding:9px 12px}
#commercial593-editor[data-view=line] .c561-fields{grid-template-columns:minmax(200px,2fr) minmax(160px,1.5fr) minmax(120px,1fr);gap:12px}
#commercial593-editor[data-view=line] .c561-fields>label:first-child{grid-column:1 / span 2}
#commercial593-editor[data-view=line] .c561-fields>label:last-child{grid-column:1 / -1}
#commercial593-editor[data-view=line] .c561-fields textarea{min-height:56px}
#commercial593-editor[data-view=line] .c561-fields>label{font-size:11px}
#commercial593-editor[data-view=confirmation] .c561-scroll{max-height:50dvh}
#commercial593-editor[data-view=confirmation] .f531-check{margin:13px 0}
#commercial593-editor[data-view=confirmation] .f531-field textarea{min-height:54px;max-width:100%;background:var(--c593-paper);color:var(--c593-ink);border-color:var(--c593-line)}
#commercial593-workspace [hidden],#commercial593-editor [hidden],.commercial593-history [hidden]{display:none!important}
html[data-theme] .budget574-dialog.commercial593-history{width:min(1200px,calc(100vw - 32px));max-height:90dvh;background:var(--c593-paper);color:var(--c593-ink)}
.commercial593-history>.b574-body{padding:16px;overflow:auto}
.commercial593-history header,.commercial593-history footer{background:var(--c593-paper);color:var(--c593-ink);border-color:var(--c593-line)}
.commercial593-history-pages{display:flex;justify-content:center;align-items:center;gap:15px;font-size:12px;margin-top:16px}
@media(max-width:1100px){.commercial593-workspace .c561-hero{flex-direction:column;gap:10px}.commercial593-heading-actions{justify-content:flex-start;max-width:none}.commercial593-filters{grid-template-columns:2fr 1fr 1fr}.commercial593-filters>.btn{grid-column:1/-1;justify-self:start}#commercial593-editor .b575-summary strong{font-size:16px}}
@media(max-width:760px){.commercial593-workspace{padding:12px;border-radius:9px}.commercial593-workspace .c561-hero h2{font-size:20px}.commercial593-heading-actions .btn,.commercial593-links .btn{min-height:42px}.commercial593-filters{grid-template-columns:1fr 1fr;padding:10px}.commercial593-filters>label:first-child{grid-column:1/-1}.commercial593-filters>.btn{justify-self:stretch;min-height:42px}.commercial593-filters input,.commercial593-filters select{font-size:16px;min-height:44px}#commercial593-editor .b574-commercial-meta .c561-fields,#commercial593-editor[data-view=line] .c561-fields{grid-template-columns:1fr}#commercial593-editor .c561-fields>.wide,#commercial593-editor[data-view=line] .c561-fields>label:first-child,#commercial593-editor[data-view=line] .c561-fields>label:last-child{grid-column:auto}#commercial593-editor .c561-fields input,#commercial593-editor .c561-fields select,#commercial593-editor .c561-fields textarea{font-size:16px;min-height:44px}#commercial593-editor .c561-actions .btn{min-height:44px;font-size:12px;flex:1 1 150px}#commercial593-editor .b575-scroll{max-height:64dvh}#commercial593-editor .b575-table :is(input,select,textarea){font-size:16px!important;min-height:44px!important;height:44px}#commercial593-editor .b575-table .b575-name{width:220px}#commercial593-editor .b575-table .b575-name>.btn{font-size:13px!important;min-height:44px!important}#commercial593-editor .b575-table .b575-group{width:135px}#commercial593-editor .b575-table .b575-detail-col{width:95px}#commercial593-editor .commercial593-row-actions .btn{font-size:11px;min-height:34px}.commercial593-history .c561-table{font-size:12px}html[data-theme] .budget574-dialog.commercial593-history{width:100vw;max-width:100vw;max-height:96dvh;border-radius:8px}}
@media print{.commercial593-workspace{--c593-paper:#fff;--c593-bg:#f4f7fa;--c593-ink:#173245;--c593-muted:#526b7c;--c593-line:#cddbe4;--c593-action:#096b7b}.commercial593-filters,.commercial593-heading-actions,.commercial593-links,#commercial593-editor .c561-actions,#commercial593-editor .commercial593-row-actions{display:none!important}.commercial593-workspace{border:0;padding:0}#commercial593-editor .b575-scroll{overflow:visible;max-height:none}#commercial593-editor .b575-table{min-width:0;font-size:8px}#commercial593-editor .b575-table :is(input,select,textarea){border:0!important;color:#173245!important;background:#fff!important}}
@media print{.commercial593-readonly .c561-search,.commercial593-workspace [data-commercial593-empty],.commercial593-readonly [data-commercial593-empty]{display:none!important}.commercial593-readonly .b575-scroll{overflow:visible;max-height:none}.commercial593-readonly .b575-table{min-width:0;font-size:8px}}
