.cui-root{--sx-paper:#fff;--sx-ink:#111;--sx-grid:#d9d9d9;--sx-edge:#222;--sx-line:#aaa;--sx-hover:#edf7ef;--sx-focus:#25843d;--sx-green:#34a853;--sx-yellow:#fbbc04;--sx-head:#d9d9d9;--sx-dark:#434343;--sx-chosen:#e8f4eb;--sx-mute:#777;--sx-note:#fff8dd;--sx-note-line:#d6ba61;--sx-save:#e8f4eb;--sx-save-line:#25843d;--sx-kp:#24613e;--sx-cell:#f1f8f2;--sx-auto:#477450;--sx-ph:#555;min-width:0;container:sx/inline-size;font:11px Arial,Helvetica,sans-serif;font-synthesis:none;color:var(--sx-ink)}
[data-theme="dark"] .cui-root{--sx-paper:#1b201d;--sx-ink:#e9eeea;--sx-grid:#39423c;--sx-edge:#7d8780;--sx-line:#5b665e;--sx-hover:#26352b;--sx-focus:#7fd59a;--sx-head:#363f39;--sx-chosen:#223a2a;--sx-mute:#a1aba4;--sx-note:#3a3416;--sx-note-line:#8a7a2c;--sx-save:#1f3a27;--sx-save-line:#4fa96b;--sx-cell:#222d26;--sx-auto:#8fcf9f;--sx-ph:#aab3ad}
.cui-root *{box-sizing:border-box}
.cui-root button,.cui-root input,.cui-root select{font:inherit;color:inherit}
.cui-root button{cursor:pointer;background:var(--sx-paper);border:1px solid var(--sx-line);border-radius:0;padding:0;touch-action:manipulation}
.cui-root button:disabled{color:var(--sx-mute);cursor:default}
.cui-root button:hover:not(:disabled){background:var(--sx-hover)}
.cui-root button:focus-visible,.cui-root input:focus-visible,.cui-root select:focus-visible,.cui-root summary:focus-visible,.cui-root a:focus-visible,.cui-root [tabindex="0"]:focus-visible{outline:2px solid var(--sx-focus);outline-offset:-1px}
.cui-root a{color:inherit}
.cui-root select{width:100%;min-width:0;height:22px;background-color:var(--sx-paper);color:var(--sx-ink);border:0;border-radius:0;padding:0 16px 0 2px;cursor:pointer;font-weight:600;color-scheme:light}
[data-theme="dark"] .cui-root select{color-scheme:dark}
.cui-root table{border-collapse:collapse;font-variant-numeric:tabular-nums}
.cui-root td,.cui-root th{border:1px solid var(--sx-grid);color:inherit}
.cui-root h1{margin:0}
.cui-root small{display:block}

.sheet-page{padding:8px 10px 12px;max-width:1800px;margin:auto;background:var(--sx-paper);border:1px solid var(--sx-grid)}
.sx-bar{display:flex;align-items:center;gap:8px;margin-bottom:8px;min-height:26px}
.sx-bar>h1{font-size:12px;font-weight:700;white-space:nowrap}
.sx-bar button{padding:4px 8px;height:26px;font-size:10px;white-space:nowrap}
.sx-bar label{display:flex;align-items:center;gap:5px;font-size:9px}
.sx-bar select{border:1px solid var(--sx-line);width:108px;height:26px;font-size:10px}
.sx-bar .spacer{flex:1}
.sx-bar .save-button{border-color:var(--sx-save-line);background:var(--sx-save);font-weight:600}
.sx-bar .save-button:hover:not(:disabled){background:var(--sx-hover)}
.cui-root .sx-bar .kp-button{background:var(--sx-kp);color:#fff;border-color:var(--sx-kp);font-weight:700}
.cui-root .sx-bar .kp-button:hover:not(:disabled){background:#19492d}
.sx-strip{display:flex;flex-wrap:wrap;gap:2px 12px;align-items:baseline;margin:0 0 8px;padding:5px 8px;border:1px solid var(--sx-grid);background:var(--sx-chosen);font-size:10px}
.sx-strip b{font-size:11px}
.reset-confirm{display:flex;align-items:center;justify-content:flex-end;gap:8px;background:var(--sx-note);border:1px solid var(--sx-note-line);padding:6px;margin-bottom:8px;font-size:10px}
.reset-confirm button{padding:4px 7px}

.sheet-layout{display:grid;grid-template-columns:minmax(370px,.98fr) minmax(440px,1.23fr) 248px;gap:14px;align-items:start}
.sheet-layout.catalog-hidden{grid-template-columns:minmax(440px,760px) 270px;justify-content:center}
.projects,.calculation,.summary{min-width:0}
.catalog-scroll{overflow-x:auto}
.catalog-table{width:100%;font-size:9px;text-align:center;white-space:nowrap}
.catalog-table th,.catalog-table td{padding:2px;height:19px}
.catalog-table thead{background:var(--sx-green);color:#111}
.catalog-table thead th{border-color:#222;font-weight:700;line-height:1.1}
.catalog-table tbody th{font-size:9px}
.catalog-table button{border:0;background:transparent;padding:0;font:inherit;width:100%;white-space:nowrap}
.catalog-table td button{font-weight:400}
.catalog-table .chosen,.catalog-table tbody tr:hover{background:var(--sx-chosen)}
.cui-root .catalog-table button:hover:not(:disabled){background:transparent;text-decoration:underline}
.project-choices{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:4px;margin-bottom:6px}
.project-choices select{border:1px solid var(--sx-line);font-size:10px;height:24px}
.calc-table{width:100%;table-layout:fixed;margin-bottom:8px}
.calc-table,.catalog-table,.summary table{outline:1px solid var(--sx-edge);outline-offset:-1px}
.name-col{width:42%}
.qty-col{width:16%}
.price-col{width:19%}
.sum-col{width:23%}
.calc-table thead th{position:relative;background:var(--sx-head);border:1px solid var(--sx-edge);padding:2px 20px;text-align:center;font-size:10px;height:20px;line-height:15px}
.calc-table td{padding:0 3px;height:22px;vertical-align:middle}
.row-name{font-size:10px;font-weight:600;line-height:1.2}
.row-name select{font-size:10px}
.row-name small,.price-cell small{display:block;font-size:8px;line-height:9px;font-weight:400}
.qty-cell,.price-cell{position:relative;text-align:center;font-size:10px;font-weight:600}
.sum-cell{text-align:right;font-size:10px;font-weight:600;white-space:nowrap}
.number-cell{display:block;width:100%;height:21px;border:0;border-radius:0;background:transparent;min-width:0;text-align:center;padding:0;font-size:10px;font-weight:600;font-variant-numeric:tabular-nums}
.number-cell:focus{background:var(--sx-cell)}
.number-cell:disabled{color:var(--sx-mute);opacity:1;-webkit-text-fill-color:var(--sx-mute)}
.section-total td{height:19px!important;font-size:10px;line-height:14px;padding:1px 3px;text-align:right;font-weight:700;border-top:1px solid var(--sx-edge)}
.section-total td:last-child{white-space:nowrap}
.auto-cell{position:absolute;bottom:0;right:1px;height:9px;line-height:8px;font-size:7px}
.cui-root .auto-cell button{background:var(--sx-paper);border:0;color:var(--sx-auto);padding:0;font-size:7px}
.project-dimensions{display:flex;align-items:center;gap:7px;font-size:9px;border:1px solid var(--sx-grid);margin-top:-3px;margin-bottom:8px;padding:0 3px;height:24px}
.project-dimensions>label{display:flex;align-items:center;gap:5px;min-width:0;flex:1}
.project-dimensions>label:last-of-type{flex:0 0 72px}
.project-dimensions b{font-size:9px;white-space:nowrap}
.project-dimensions .number-cell{max-width:55px;min-width:24px}
.cui-root .restore-rates{border:0;font-size:8px;padding:0;text-decoration:underline}
.cui-root .add-row{position:absolute;right:2px;top:0;width:22px;height:19px;border:0;background:transparent;padding:0;font-size:17px;line-height:16px;color:inherit}
.free-name{width:100%;height:22px;border:0;background:var(--sx-paper);min-width:0;font-size:10px;font-weight:600;padding:0}
.free-name::placeholder{color:var(--sx-ph)}
.rate-note{font-size:8px;line-height:1.3;margin:0 0 5px;color:var(--sx-mute)}
.error{background:var(--sx-note);border:1px solid var(--sx-note-line);padding:6px;font-size:9px;margin:0 0 6px}

.summary{position:sticky;top:calc(var(--top-h) + 8px);padding-top:30px}
.cui-over .summary{top:8px}
.summary>details>summary{display:none}
.summary table{width:100%;text-align:center;font-size:10px;margin-bottom:8px}
.summary th,.summary td{height:20px;padding:2px 3px;line-height:1.2}
.summary tbody th{font-size:9px;width:60%;font-weight:600}
.summary td{font-weight:700;white-space:nowrap}
.summary thead th{border:1px solid #222;color:#111}
.summary-table thead{background:var(--sx-yellow)}
.grand-total td,.grand-total th{border-top:1px solid var(--sx-edge)}
.payments thead{background:var(--sx-dark);color:#fff}
.cui-root .payments thead th{color:#fff}
.income thead{background:var(--sx-green)}
.sheet-footer{display:flex;justify-content:space-between;gap:10px;font-size:8px;line-height:1.3;color:var(--sx-mute);border-top:1px solid var(--sx-grid);padding-top:6px;margin-top:4px}
.sheet-footer a{white-space:nowrap}

@container sx (min-width:1550px){.catalog-table,.catalog-table tbody th{font-size:10px}.catalog-table th,.catalog-table td{height:21px}}
@container sx (max-width:1250px){.sheet-layout,.sheet-layout.catalog-hidden{grid-template-columns:minmax(390px,1fr) 246px;gap:12px;max-width:1000px;margin:auto}.projects{grid-column:1/-1}.catalog-table{min-width:600px}.catalog-table,.catalog-table tbody th{font-size:10px}.summary tbody th{font-size:9px}.summary table{font-size:10px}.sx-bar{flex-wrap:wrap}}
@container sx (max-width:760px){
  .sheet-page{padding:4px 5px 8px;max-width:600px}
  .sx-bar{gap:4px;margin-bottom:5px;min-height:0}
  .sx-bar>h1{font-size:10px;flex:1 1 auto}
  .sx-bar button{height:21px;padding:2px 5px;font-size:9px}
  .sx-bar .spacer{display:none}
  .sx-bar label{font-size:8px;gap:3px}
  .sx-bar select{width:82px;height:21px;font-size:9px}
  .sx-bar .reset{margin-left:auto}
  .sheet-layout,.sheet-layout.catalog-hidden{display:flex;flex-direction:column;gap:0;max-width:none}
  .projects{width:100%;margin-bottom:6px}
  .calculation,.summary{width:100%}
  .project-choices{gap:3px;margin-bottom:5px}
  .project-choices select{height:22px;font-size:9px;padding-left:2px;padding-right:12px}
  .calc-table{margin-bottom:6px}
  .qty-col{width:14%}
  .sum-col{width:25%}
  .calc-table thead th{height:18px;padding:0 20px;font-size:9px;line-height:16px}
  .calc-table td{height:19px;padding:0 2px}
  .row-name{font-size:9px;line-height:10px}
  .row-name select{font-size:9px;height:19px;padding-left:0;padding-right:12px}
  .qty-cell,.price-cell,.sum-cell{font-size:9px}
  .number-cell{height:19px;font-size:9px}
  .row-name small,.price-cell small{display:inline;font-size:7px;line-height:8px;margin-left:3px}
  .section-total td{height:17px!important;font-size:9px;line-height:13px;padding:0 2px}
  .project-dimensions{height:20px;font-size:8px;margin-top:-2px;margin-bottom:6px;gap:6px;padding:0 2px}
  .project-dimensions b{font-size:8px}
  .project-dimensions>label{gap:2px}
  .project-dimensions>label:last-of-type{flex-basis:57px}
  .project-dimensions .number-cell{width:38px;height:18px}
  .cui-root .restore-rates{font-size:7px}
  .free-name{height:19px;font-size:9px}
  .cui-root .add-row{height:17px;font-size:15px;line-height:15px}
  .auto-cell{bottom:-1px;right:0;font-size:6px}
  .cui-root .auto-cell button{font-size:6px;line-height:7px}
  .summary{position:static;padding-top:0}
  .summary>details>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--sx-yellow);color:#111;border:1px solid #222;padding:4px 6px;min-height:25px;font-size:9px;font-weight:600;cursor:pointer;margin-bottom:6px;list-style:none}
  .summary>details>summary::-webkit-details-marker{display:none}
  .summary>details>summary::before{content:'▸';font-size:9px}
  .summary>details[open]>summary::before{content:'▾'}
  .summary>details>summary>b{margin-left:auto}
  .summary table{font-size:9px;margin-bottom:6px}
  .summary th,.summary td{height:18px;padding:1px 3px}
  .summary-table{display:none}
  .sheet-footer{margin-top:1px;padding-top:4px;font-size:7px;gap:8px}
  .reset-confirm{flex-wrap:wrap;font-size:9px;gap:5px}
  .reset-confirm span{width:100%}
  .rate-note{font-size:7px;margin-bottom:4px}
  .error{font-size:8px}
}
@container sx (max-width:360px){.sheet-page{padding-left:3px;padding-right:3px}.sx-bar label{font-size:7px}.sx-bar select{width:76px;font-size:8px}.qty-col{width:13%}.sum-col{width:26%}.sum-cell{font-size:8px}.row-name select{font-size:8px}}

.cui-grand{font-size:26px;font-weight:700;letter-spacing:-.01em;font-variant-numeric:tabular-nums;line-height:1.15;margin-bottom:6px}
.cui-list{margin:0 0 8px;border-top:1px solid var(--line)}
.cui-list>div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid var(--line);font-size:13px}
.cui-list dt{color:var(--muted);min-width:0}
.cui-list dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.cui-tab{padding:16px;display:flex;flex-direction:column;gap:4px}
.cui-tab .cui-list{margin:10px 0 4px}
.cui-tab-b{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.cui-tab-empty{padding:24px 12px}

.cui-over{position:fixed;inset:0;z-index:74;background:var(--milk);display:flex;flex-direction:column;animation:fade .2s;padding-bottom:env(safe-area-inset-bottom)}
.cui-over-top{display:flex;align-items:center;gap:8px;padding:6px 12px;min-height:48px;background:var(--surface);border-bottom:1px solid var(--line);flex:0 0 auto}
.cui-over-t{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.cui-over-t b{font-size:14px}
.cui-over-t span{font-size:12px}
.cui-over-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px 16px 24px}
@media (max-width:860px){
  .cui-over-body{padding:10px 12px 20px}
}
@media (prefers-reduced-motion:reduce){
  .cui-over{animation:none}
}
