.sheet-tool{display:grid;grid-template-columns:minmax(0,1fr) 360px;grid-template-areas:"result form";align-items:start;gap:16px;padding-top:24px;padding-bottom:40px}
.sheet-tool [hidden]{display:none}
.sheet-form{grid-area:form;display:grid;gap:13px;min-width:0}
.sheet-result{grid-area:result;scroll-margin-top:72px}
.sheet-panel{min-width:0;padding:16px;background:#fff;border:1px solid #dce4ef;border-radius:14px}
.sheet-panel h2{margin:0 0 12px;color:#1e3553;font-size:17px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sheet-head h2{margin:0}
.sheet-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:9px}
.sheet-field{display:grid;min-width:0;gap:4px;color:#42536b;font-size:12px;font-weight:650}
.sheet-field input,.sheet-field select{width:100%;min-width:0;min-height:36px;box-sizing:border-box;padding:6px 8px;border:1px solid #cbd6e5;border-radius:7px;background:#fff;color:#142844;font:inherit;font-size:14px;font-weight:400}
.sheet-field input:focus,.sheet-field select:focus,.sheet-tool button:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
#sheet-density-field{margin-top:9px}
.sheet-check{display:flex;align-items:center;gap:5px;margin-top:9px;color:#263b58;font-size:13px}
.sheet-check input{width:16px;height:16px;accent-color:#2563eb}
.sheet-note,.sheet-error{margin:8px 0 0;color:#495d78;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.sheet-error{margin:0;color:#9f252c}
.sheet-error:empty{display:none}
.sheet-button{min-height:32px;padding:5px 8px;border:1px solid #cad6e6;border-radius:7px;background:#fff;color:#263b58;cursor:pointer;font:inherit;font-size:12px;white-space:nowrap}
.sheet-button:hover{background:#eef4fc}
.sheet-button:disabled,.sheet-submit:disabled{cursor:default;opacity:.55}
.sheet-part{min-width:0;margin:9px 0 0;padding:9px;border:1px solid #dce4ef;border-radius:8px;background:#f8faff}
.sheet-part legend{padding:0 4px;color:#1e3553;font-size:13px;font-weight:700}
.sheet-part .sheet-fields{margin-top:0}
.sheet-part-actions{display:flex;gap:6px;align-items:center;justify-content:space-between;margin-top:8px}
.sheet-part-actions .sheet-check{margin:0}
.sheet-part-actions [data-remove]{margin-left:auto}
#sheet-add{margin-top:9px}
.sheet-tool .sheet-submit{width:100%;justify-content:center;border-radius:8px}
.sheet-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0 0 10px}
.sheet-totals div{min-width:0;padding:8px;border-radius:8px;background:#eef4fc;overflow-wrap:anywhere}
.sheet-totals dt{color:#435675;font-size:12px}
.sheet-totals dd{margin:4px 0 0;color:#142844;font-size:clamp(14px,2vw,20px);font-weight:700}
.sheet-view-controls{display:flex;align-items:end;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.sheet-view-controls select{min-width:108px}
#sheet-canvas{display:block;width:100%;height:clamp(220px,36vw,480px);background:#eef3f9;border:1px solid #dce4ef;border-radius:9px}
.sheet-usage{width:100%;border-collapse:collapse;color:#263b58;font-size:13px;font-variant-numeric:tabular-nums}
.sheet-usage caption{text-align:left;color:#1e3553;font-weight:700;padding:7px 0}
.sheet-usage th,.sheet-usage td{padding:6px 8px;text-align:right;border-bottom:1px solid #dce4ef}
.sheet-usage thead th{background:#f2f6fc;color:#435675;font-size:12px}
.sheet-usage tr > :first-child{text-align:left}
.sheet-usage tbody tr{cursor:pointer}
.sheet-usage tbody tr:hover,.sheet-usage tbody tr:has([aria-current=true]){background:#eef4fc}
.sheet-usage button[aria-current=true]{background:#deebff;border-color:#8cb4f5;color:#164f9e;font-weight:700}
.sheet-legend,.sheet-counts ul{display:flex;flex-wrap:wrap;gap:5px 9px;margin:8px 0;padding:0;list-style:none}
.sheet-legend li,.sheet-counts li{display:flex;gap:4px;align-items:center;min-width:0;padding:3px 5px;color:#263b58;font-size:12px;overflow-wrap:anywhere}
.sheet-legend i{width:10px;height:10px;flex:none;border-radius:2px}
.sheet-counts{margin:10px 0;color:#435675;font-size:13px}
.sheet-counts summary{cursor:pointer}
.sheet-counts li{border:1px solid #dce4ef;border-radius:6px}
.sheet-counts li[data-unplaced],.sheet-rejected{color:#922c24}
.sheet-rejected{margin:8px 0;padding:7px 7px 7px 25px;background:#fff1ef;border-radius:7px;font-size:13px;overflow-wrap:anywhere}
@media(max-width:900px){.sheet-tool{grid-template-columns:minmax(0,1fr);grid-template-areas:"form" "result"}}
@media(max-width:420px){.sheet-panel{padding:11px}.sheet-totals{grid-template-columns:repeat(2,minmax(0,1fr))}}
.sheet-mode{margin-top:9px}
.sheet-price{margin-top:8px}
.sheet-head-actions{display:flex;gap:6px}
.sheet-remnant{margin:8px 0 0;padding:8px 10px;border-radius:8px;background:#ecfdf3;color:#166534;font-size:13px}
.sheet-remnant[data-none]{background:#f4f7fb;color:#54657c}
.sheet-compare{margin-top:14px}
.sheet-compare h3{margin:0 0 6px;color:#1e3553;font-size:15px}
.sheet-compare-wrap{overflow-x:auto}
.sheet-compare-table th,.sheet-compare-table td{white-space:nowrap}
.sheet-compare-table tr[data-current]{background:#eaf2ff}
.sheet-compare-table tr[data-best] th{color:#166534}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media print{.sheet-form,.sheet-import{margin:9px 0 0;padding:8px 10px;border-radius:8px;background:#ecfdf3;color:#166534;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.sheet-link a{color:#1d4ed8;font-weight:700}
