:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#15374d;background:#f3f7fa}*{box-sizing:border-box}body{margin:0}header{background:linear-gradient(125deg,#103c61,#086a83);color:white;padding:28px 0}header h1{font-size:2rem;margin:4px 0}header p{margin:0;color:#e1eef4}.eyebrow{font-size:.75rem;letter-spacing:.12em;font-weight:700;color:#c3e4ee}.wrap{width:min(920px,calc(100% - 28px));margin:auto}main{padding:22px 0}.card{background:white;border:1px solid #dce6ed;border-radius:15px;padding:20px;margin-bottom:16px;box-shadow:0 3px 14px #102b4009}h2{font-size:1.15rem;margin:0 0 12px}.help{font-size:.92rem;line-height:1.5;color:#526b7b}.toolbar{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0}.heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}button,.filebutton{border:0;border-radius:9px;padding:11px 14px;background:#103c61;color:white;font:inherit;cursor:pointer;display:inline-block}button:disabled{opacity:.45;cursor:not-allowed}.secondary{background:#e6eef3;color:#103c61}.danger{background:#fff0e9;color:#843a20}input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}input[type=text],input[type=number]{width:100%;min-width:0;border:1px solid #c5d3dc;border-radius:8px;padding:10px;font:inherit;background:white}label{display:block;font-size:.84rem;font-weight:650;margin-bottom:5px}.stage{position:relative;display:inline-block;max-width:100%;background:#edf2f5;border:1px dashed #b6cbd8;border-radius:10px;overflow:hidden;min-width:180px;min-height:90px}canvas{display:block;max-width:100%;height:auto}#selectionCanvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}#photoHint{margin:0;padding:35px 18px;text-align:center;color:#667d8c}#photoCanvas:not([width="300"])+#selectionCanvas+#photoHint{display:none}.status{background:#eef5f8;border-radius:9px;padding:12px;min-height:42px;white-space:pre-wrap}.items{display:grid;gap:12px}.item{border:1px solid #dce5eb;border-radius:12px;padding:14px}.itemtop{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}.itemtop strong{font-size:.93rem}.itemgrid{display:grid;grid-template-columns:1fr 95px 90px 110px;gap:10px}.raw{font-size:.8rem;color:#617888;overflow-wrap:anywhere;margin:10px 0 0}.total{font-size:1.3rem;font-weight:750;text-align:right;margin-top:20px;padding:16px 0;border-top:1px solid #dce5eb}footer{text-align:center;color:#668090;padding:14px 0 30px;font-size:.85rem}@media(max-width:680px){.itemgrid{grid-template-columns:1fr 1fr}.itemgrid .product{grid-column:1/-1}.card{padding:14px}header h1{font-size:1.65rem}}@media(max-width:360px){.itemgrid{grid-template-columns:1fr}}

/* Mantener la foto completa visible y alinear la capa de selección con ella. */
.stage{display:block;width:100%;max-width:100%;min-width:0}
#photoCanvas{display:block;width:100%;max-width:100%;height:auto}
#selectionCanvas{width:100%;height:100%}
