*{box-sizing:border-box}body{margin:0;background:#e9eef3;color:#17202a;font-family:Segoe UI,system-ui,sans-serif}button,input,select{font:inherit}button{border:1px solid #94a3b8;background:#e6edf5;color:#17202a;min-height:42px;padding:8px 14px;display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;white-space:nowrap}button.recommended:not(:disabled){border-color:#1d4ed8;background:#2563eb;color:#fff;box-shadow:0 0 0 3px #2563eb29}button.recommended:not(:disabled):hover{background:#1d4ed8}button:disabled{color:#94a3b8;background:#eef3f8;border-color:#c9d4e0;cursor:not-allowed}input,select{border:1px solid #cbd5e1;background:#f1f5f9;color:#17202a;min-height:38px;padding:6px 9px;min-width:0}select:focus,select option{background:#f1f5f9;color:#17202a}.app-shell{min-height:100vh;padding:14px}.app-header,.toolbar,.statusbar{display:flex;align-items:center;gap:12px}.app-header{justify-content:space-between;flex-wrap:wrap}h1{margin:0;font-size:20px;text-transform:uppercase}h2{margin:0 0 12px;font-size:18px}h3{margin:0 0 8px;font-size:14px}.api-panel{display:flex;align-items:end;flex-wrap:wrap;gap:10px}label{display:grid;gap:4px;font-size:14px}.check-row{display:flex;align-items:center;min-height:32px}.secret-input{display:flex}.secret-input input{width:min(240px,34vw)}.secret-input button{min-width:38px;padding:0}.security-note{margin:8px 0 14px;color:#526170;font-size:13px}.toolbar{margin-bottom:14px;align-items:end;flex-wrap:wrap}.toolbar-control{display:flex;align-items:center;gap:8px;min-height:42px}.toolbar-control select{min-height:42px;width:94px}.toolbar-control.compact-control input{min-height:42px;width:64px}.toolbar-control.upload-mode-control select{width:155px}.workspace{display:grid;grid-template-columns:minmax(360px,1.15fr) minmax(300px,.8fr) minmax(360px,1fr);gap:12px;min-height:calc(100vh - 205px)}.panel{background:#f8fafc;padding:14px;min-width:0}.receipt-table{border:1px solid #cbd5e1;min-height:clamp(330px,calc(100vh - 335px),560px);background:#f8fafc;overflow:auto}.receipt-row{width:100%;display:grid;grid-template-columns:2fr 1fr 1fr .8fr;border:0;border-bottom:1px solid #d7e1ec;min-height:30px;text-align:left;background:#f8fafc;padding:0}.receipt-row span{padding:5px 8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.receipt-heading{background:#e2eaf3;font-weight:700;text-align:center}.receipt-row.selected{background:#2f6f9f;color:#fff}.receipt-row.needs-attention{background:#fff1f2;color:#881337;border-left:4px solid #dc2626}.receipt-row.needs-attention.selected{background:#9f1239;color:#fff}.row-actions{display:flex;gap:10px;margin-top:12px}.details-grid{display:grid;grid-template-columns:minmax(105px,.45fr) minmax(150px,1fr);gap:9px 10px}.details-grid label{display:contents}.details-grid label>input,.details-grid label>select{width:100%}.rate-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px 12px;margin-bottom:16px}.rate-row label{display:grid;grid-template-columns:auto minmax(78px,1fr);align-items:center;gap:8px;min-width:0}.rate-row label>input{width:100%}.preview-header{display:flex;align-items:center;justify-content:space-between}.icon-row{display:flex;gap:8px}.preview-grid{display:grid;grid-template-columns:1fr;border:1px solid #17202a;min-height:clamp(380px,calc(100vh - 285px),720px);background:#f5f7fa;overflow:auto}.preview-grid.with-proof{grid-template-columns:1fr 46px .8fr}.image-stack{padding:12px;min-width:0;display:flex;flex-direction:column;gap:10px}.proof-stack{border-left:1px solid #d8e1ec}.swap-divider{display:flex;align-items:center;justify-content:center}.swap-divider button{border-radius:50%;width:36px;height:36px;padding:0}.hidden-drop{min-height:40px;border:1px dashed #cbd5e1}.crop-editor{min-height:0}.crop-stage{min-height:clamp(350px,calc(100vh - 315px),720px);border:1px solid #17202a;background:#fff;display:flex;align-items:center;justify-content:center;overflow:auto;padding:12px}.preview-grid.with-proof .crop-stage{min-height:clamp(280px,calc(100vh - 380px),520px)}.crop-image-wrap{position:relative;display:inline-block;line-height:0;max-width:100%}.crop-image{display:block;max-width:100%;max-height:clamp(320px,calc(100vh - 365px),680px);object-fit:contain;-webkit-user-select:none;user-select:none;pointer-events:none}.preview-grid.with-proof .crop-image{max-height:clamp(250px,calc(100vh - 430px),480px)}.crop-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;pointer-events:none}.crop-overlay polygon{fill:#2563eb0f;stroke:#2563eb;stroke-width:2;vector-effect:non-scaling-stroke}.crop-handle{position:absolute;width:18px;height:18px;min-height:18px;padding:0;border:2px solid #2563eb;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0f172a47;transform:translate(-50%,-50%);cursor:grab;touch-action:none;z-index:2}.crop-handle:active{cursor:grabbing}.thumbnail-strip{display:grid;grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:8px;max-height:96px;overflow:auto}.thumbnail-button{min-height:58px;padding:4px;background:#fff;border:1px solid #cbd5e1}.thumbnail-button.selected{border-color:#2563eb;box-shadow:inset 0 0 0 1px #2563eb}.thumbnail-button img{width:100%;height:48px;object-fit:contain}.empty-state{color:#64748b;display:grid;place-items:center;min-height:160px;text-align:center}.statusbar{margin-top:12px;color:#526170}.statusbar progress{width:min(180px,20vw);height:12px;accent-color:#2563eb}.report-stats{color:#17202a;font-weight:600}.template-links{margin-left:auto;color:#17202a;display:inline-flex;align-items:center;gap:6px}.template-links a,.template-links button{color:#17202a;text-decoration:none;border:1px solid #cbd5e1;background:#f8fafc;padding:4px 8px;font:inherit;display:inline-flex;align-items:center;gap:4px}.template-links a:hover,.template-links button:hover:not(:disabled){border-color:#2563eb;color:#1d4ed8}.template-links button:disabled{opacity:.55}.spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(max-width:1280px){.workspace{grid-template-columns:minmax(360px,1fr) minmax(300px,.85fr)}.preview-panel{grid-column:1 / -1}}@media(max-width:900px){.app-shell{padding:10px}.app-header,.toolbar,.statusbar{align-items:stretch}.api-panel,.toolbar{width:100%}.toolbar>button,.toolbar-control{flex:1 1 220px}.workspace{grid-template-columns:1fr}.details-grid{grid-template-columns:minmax(105px,.4fr) minmax(150px,1fr)}.rate-row{grid-template-columns:1fr}.rate-row label{grid-template-columns:auto minmax(92px,1fr)}.preview-grid.with-proof{grid-template-columns:1fr}.swap-divider{min-height:42px}.proof-stack{border-left:0;border-top:1px solid #d8e1ec}.template-links{margin-left:0}}
