*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:#f4f5f7;color:#1a1a1a;min-height:100vh;}
header{background:#003057;color:#fff;padding:1rem 2rem;}
header h1{font-size:18px;font-weight:600;}
header span{font-size:13px;opacity:.7;}
.container{max-width:800px;margin:0 auto;padding:2rem 1.5rem;}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.5rem;margin-bottom:1.25rem;}
.card-title{font-size:11px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:.07em;margin-bottom:1rem;}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.75rem;}
@media(max-width:500px){.grid2,.grid3{grid-template-columns:1fr;}}
.field{margin-bottom:.5rem;}
.field label{display:block;font-size:13px;color:#374151;margin-bottom:4px;}
input[type=text],input[type=number],select{width:100%;height:38px;border:1px solid #d1d5db;border-radius:8px;padding:0 12px;font-size:14px;color:#1a1a1a;background:#fff;outline:none;transition:border-color .15s;}
input[type=text]:focus,input[type=number]:focus,select:focus{border-color:#003057;box-shadow:0 0 0 3px rgba(0,48,87,.1);}
.upload-zone{border:2px dashed #d1d5db;border-radius:10px;padding:2rem;text-align:center;cursor:pointer;transition:border-color .15s,background .15s;}
.upload-zone:hover{border-color:#003057;background:#f0f4f8;}
.upload-zone.loaded{border-color:#16a34a;background:#f0fdf4;border-style:solid;}
.upload-icon{font-size:32px;margin-bottom:.5rem;}
.upload-label{font-size:14px;color:#374151;font-weight:500;}
.upload-sub{font-size:12px;color:#9ca3af;margin-top:4px;}
.upload-ok{font-size:14px;color:#16a34a;font-weight:600;}
.upload-err{font-size:13px;color:#dc2626;margin-top:.5rem;padding:.5rem;background:#fef2f2;border-radius:6px;}
.search-wrap{position:relative;}
#dropResults{position:absolute;z-index:100;width:100%;background:#fff;border:1px solid #d1d5db;border-radius:10px;margin-top:4px;display:none;max-height:300px;overflow-y:auto;box-shadow:0 8px 24px rgba(0,0,0,.1);}
.dr-item{padding:10px 14px;font-size:13px;cursor:pointer;border-bottom:1px solid #f3f4f6;color:#1a1a1a;display:flex;gap:12px;align-items:center;}
.dr-item:last-child{border-bottom:none;}
.dr-item:hover{background:#f9fafb;}
.dr-item small{color:#9ca3af;font-size:11px;display:block;margin-top:3px;}
.dr-thumb{width:48px;height:48px;flex:0 0 48px;border:1px solid #e5e7eb;border-radius:7px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#9ca3af;font-size:9px;text-align:center;}
.dr-thumb img{width:100%;height:100%;object-fit:contain;display:block;}
.dr-copy{min-width:0;flex:1;}
.badge{display:inline-block;border-radius:4px;padding:1px 7px;font-size:11px;font-weight:600;margin-left:5px;vertical-align:middle;}
.badge-p1{background:#d1fae5;color:#065f46;}
.badge-p2{background:#dbeafe;color:#1e40af;}
.selected-product{background:#f8faff;border:1px solid #bfdbfe;border-radius:10px;padding:1rem;margin-top:.75rem;}
.selected-product-head{display:flex;gap:14px;align-items:flex-start;}
.selected-product-main{min-width:0;flex:1;}
.product-image-shell{width:96px;height:96px;flex:0 0 96px;border:1px solid #dbeafe;border-radius:9px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#9ca3af;font-size:11px;text-align:center;}
.product-image-shell img{width:100%;height:100%;object-fit:contain;display:none;}
.prod-name{font-size:14px;font-weight:600;color:#1a1a1a;margin-bottom:.75rem;display:flex;align-items:center;justify-content:space-between;}
.prod-name button{background:none;border:none;cursor:pointer;color:#9ca3af;font-size:18px;line-height:1;}
.prod-name button:hover{color:#ef4444;}
.variant-label{font-size:12px;color:#6b7280;font-weight:500;margin-bottom:6px;text-transform:uppercase;letter-spacing:.04em;}
.variant-select{width:100%;height:42px;border:1.5px solid #003057;border-radius:8px;padding:0 12px;font-size:14px;color:#003057;background:#fff;font-weight:500;cursor:pointer;}
.variant-info{display:flex;gap:1rem;margin-top:.75rem;flex-wrap:wrap;}
.vinfo-item{font-size:12px;color:#6b7280;}
.vinfo-item strong{color:#111827;font-weight:600;}
.ldt-wrap{margin-top:1rem;padding-top:.9rem;border-top:1px solid #dbeafe;}
.ldt-wrap label{display:block;font-size:12px;font-weight:600;color:#374151;margin-bottom:6px;}
.ldt-wrap label span{font-weight:400;color:#6b7280;}
.ldt-wrap input[type=file]{display:block;width:100%;font-size:12px;color:#4b5563;}
.ldt-status{font-size:11px;color:#6b7280;margin-top:6px;line-height:1.4;}
.ldt-status.ok{color:#15803d;}
.ldt-status.err{color:#b45309;}
.calc-settings{margin-top:.35rem;padding-top:.85rem;border-top:1px solid #f3f4f6;}
@media(max-width:500px){.product-image-shell{width:76px;height:76px;flex-basis:76px;}}
.btn-row{display:flex;gap:10px;margin-top:.25rem;}
.btn-primary{flex:1;background:#003057;color:#fff;border:none;border-radius:8px;height:42px;font-size:15px;font-weight:500;cursor:pointer;transition:background .15s;}
.btn-primary:hover{background:#004a85;}
.btn-secondary{flex:0 0 120px;background:#fff;color:#374151;border:1px solid #d1d5db;border-radius:8px;height:42px;font-size:14px;cursor:pointer;}
.btn-secondary:hover{background:#f9fafb;}
.btn-pdf{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;background:#fff;color:#003057;border:1.5px solid #003057;border-radius:8px;height:42px;font-size:14px;font-weight:500;cursor:pointer;margin-top:.75rem;transition:background .15s;}
.btn-pdf:hover{background:#f0f4f8;}
.hidden{display:none;}
.metrics{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:1rem;}
.metric{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:1rem 1.25rem;}
.metric .val{font-size:26px;font-weight:600;color:#003057;}
.metric .lbl{font-size:12px;color:#6b7280;margin-top:3px;}
.sec-title{font-size:12px;font-weight:600;color:#003057;margin:1rem 0 .5rem;text-transform:uppercase;letter-spacing:.04em;}
.drow{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid #f3f4f6;font-size:13px;}
.drow:last-child{border-bottom:none;}
.drow .k{color:#6b7280;}
.drow .v{font-weight:500;color:#111827;text-align:right;max-width:60%;}
canvas{display:block;width:100%;border-radius:8px;background:#f9fafb;}
.no-file{text-align:center;padding:3rem 1rem;color:#9ca3af;font-size:14px;}
.no-file .big{font-size:40px;margin-bottom:.75rem;}
footer{text-align:center;font-size:12px;color:#9ca3af;padding:2rem 0 3rem;}
