.cert-designer{display:grid;gap:10px}
.cert-toolbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:10px 12px;box-shadow:0 1px 2px rgba(16,24,40,.05)}
.cert-toolbar-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.cert-toolbar-controls label{display:flex;align-items:center;gap:7px}.cert-toolbar-controls input[type=range]{width:120px;padding:0}
.cert-toolbar .icon-btn.active,.cert-toolbar .icon-btn[aria-pressed=true]{border-color:#93c5fd;background:#eff6ff;box-shadow:0 0 0 2px rgba(147,197,253,.32)}
.cert-propbar{position:sticky;top:60px;z-index:25;border:1px solid var(--line);border-radius:8px;background:#fff;padding:9px 10px;box-shadow:0 1px 2px rgba(16,24,40,.05)}
.cert-designer-grid{display:grid;grid-template-columns:250px minmax(0,1fr) 235px;gap:12px;align-items:start}.cert-panel{border:1px solid var(--line);border-radius:8px;background:#fff;padding:12px;display:grid;gap:10px;max-height:calc(100vh - 178px);overflow:auto}.cert-layer-panel{padding:10px}.cert-panel h2{margin:8px 0 2px;font-size:14px;color:#334155;text-transform:uppercase}
.cert-palette,.cert-assets,.cert-layers{display:grid;gap:7px}.cert-palette button,.cert-asset-choice,.cert-layer{border:1px solid #dbe3ee;background:#f8fafc;border-radius:7px;padding:8px 10px;text-align:left;cursor:pointer;color:#18324a;font:inherit;transition:transform .14s ease,box-shadow .14s ease}.cert-palette button:hover,.cert-asset-choice:hover,.cert-layer:hover{transform:scale(1.02);box-shadow:0 8px 20px rgba(15,23,42,.09)}.cert-palette button small,.cert-asset-choice small,.cert-layer small{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.cert-asset-form{border:1px solid #e5edf5;border-radius:8px;padding:9px;background:#f8fafc}.cert-asset-form .cf-drop-zone{min-height:92px;padding:10px}.cert-asset-form .icon-btn{width:42px;height:42px}
.cert-canvas-wrap{border:1px solid var(--line);border-radius:8px;background:#e8eef6;min-height:calc(100vh - 178px);overflow:hidden}.cert-canvas-scroll{width:100%;height:calc(100vh - 180px);overflow:auto;padding:34px;display:grid;place-items:start center;cursor:default}.cert-canvas-stage{position:relative;background:#fff;border:1px solid #cbd5e1;box-shadow:0 18px 40px rgba(15,23,42,.18);transform-origin:top center;overflow:hidden;touch-action:none}.cert-canvas-stage.grid:after{content:"";position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(to right,rgba(21,91,141,.12) 1px,transparent 1px),linear-gradient(to bottom,rgba(21,91,141,.12) 1px,transparent 1px);background-size:var(--grid-size,10px) var(--grid-size,10px)}
.cert-bg{position:absolute;left:0;top:0;width:100%;height:100%;z-index:0;transform-origin:center center;overflow:hidden}.cert-bg-media{position:absolute;display:block;max-width:none;max-height:none}.cert-bg.selected{outline:2px solid #155b8d;outline-offset:-2px;box-shadow:inset 0 0 0 3px rgba(21,91,141,.16)}.cert-bg-empty{position:absolute;inset:0;display:grid;place-items:center;color:#94a3b8;background:linear-gradient(135deg,#fff,#f8fafc);z-index:0}.cert-bg-control{position:absolute;z-index:1;border:1px solid #155b8d;box-shadow:0 0 0 2px rgba(21,91,141,.18),inset 0 0 0 2px rgba(255,255,255,.55);cursor:move;transform-origin:center center}
.cert-el{position:absolute;z-index:2;border:1px solid transparent;display:flex;align-items:center;justify-content:center;min-width:12px;min-height:12px;cursor:move;user-select:none;overflow:hidden}.cert-el.selected{border-color:#155b8d;box-shadow:0 0 0 2px rgba(21,91,141,.18);overflow:visible}.cert-el-text{white-space:pre-wrap;padding:2px 5px}.cert-el-media{position:absolute;inset:0;overflow:hidden;border-radius:inherit}.cert-el-content{position:absolute;display:block;max-width:none;max-height:none}.cert-el-image .cert-el-content,.cert-el-qr .cert-el-content{object-fit:contain}.cert-el-placeholder{background:#f8fafc;border:1px dashed #94a3b8;color:#64748b;font-weight:700;text-align:center}.cert-el-placeholder-fill{display:grid;place-items:center;padding:6px;background:#f8fafc;color:#64748b}.cert-el:not(.selected) .cert-handle,.cert-el:not(.selected) .cert-crop-handle,.cert-el:not(.selected) .cert-rotate-handle{display:none}.cert-handle{position:absolute;width:10px;height:10px;border:1px solid #155b8d;background:#fff;border-radius:50%;z-index:4}.cert-handle.nw{left:-5px;top:-5px;cursor:nwse-resize}.cert-handle.ne{right:-5px;top:-5px;cursor:nesw-resize}.cert-handle.sw{left:-5px;bottom:-5px;cursor:nesw-resize}.cert-handle.se{right:-5px;bottom:-5px;cursor:nwse-resize}.cert-crop-handle{position:absolute;z-index:4;background:#155b8d;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 4px rgba(15,23,42,.18)}.cert-crop-handle.crop-n,.cert-crop-handle.crop-s{left:50%;width:24px;height:6px;margin-left:-12px;cursor:ns-resize}.cert-crop-handle.crop-w,.cert-crop-handle.crop-e{top:50%;width:6px;height:24px;margin-top:-12px;cursor:ew-resize}.cert-crop-handle.crop-n{top:-3px}.cert-crop-handle.crop-s{bottom:-3px}.cert-crop-handle.crop-w{left:-3px}.cert-crop-handle.crop-e{right:-3px}.cert-bg-control .cert-handle.nw{left:4px;top:4px}.cert-bg-control .cert-handle.ne{right:4px;top:4px}.cert-bg-control .cert-handle.sw{left:4px;bottom:4px}.cert-bg-control .cert-handle.se{right:4px;bottom:4px}.cert-bg-control .cert-crop-handle.crop-n{top:5px}.cert-bg-control .cert-crop-handle.crop-s{bottom:5px}.cert-bg-control .cert-crop-handle.crop-w{left:5px}.cert-bg-control .cert-crop-handle.crop-e{right:5px}.cert-rotate-handle{position:absolute;left:50%;top:12px;width:14px;height:14px;margin-left:-7px;border:2px solid #155b8d;background:#fff;border-radius:50%;z-index:5;cursor:grab;box-shadow:0 1px 4px rgba(15,23,42,.18)}.cert-rotate-handle:before{content:"";position:absolute;left:5px;top:-13px;width:2px;height:12px;background:#155b8d}.cert-el.selected .cert-rotate-handle{top:-28px}.cert-designer[data-tool=hand] .cert-canvas-scroll{cursor:grab}.cert-designer[data-tool=hand].is-panning .cert-canvas-scroll{cursor:grabbing}.cert-designer[data-tool=hand] .cert-el,.cert-designer[data-tool=hand] .cert-bg-control{pointer-events:none}.cert-designer[data-tool=hand] .cert-handle,.cert-designer[data-tool=hand] .cert-crop-handle,.cert-designer[data-tool=hand] .cert-rotate-handle{display:none}
.cert-props{display:flex;align-items:end;flex-wrap:wrap;gap:6px 7px}.cert-props .field{display:grid;gap:3px;flex:0 0 68px}.cert-props .field.compact{flex-basis:60px}.cert-props .field.text-field{flex:1 1 210px;min-width:min(260px,100%)}.cert-props .field.color-field{flex-basis:52px}.cert-props label{font-size:11px}.cert-props input,.cert-props select,.cert-props textarea{padding:6px 7px;min-height:32px}.cert-props input[type=color]{padding:3px}.cert-props textarea{min-height:34px;max-height:62px}.cert-props .empty{padding:8px 2px;color:var(--muted)}.cert-props .help.warn{align-self:center;color:var(--warn);font-weight:700;max-width:140px}.cert-input-suffix{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:3px}.cert-input-suffix span{color:var(--muted);font-size:11px}.cert-inline{display:contents}.cert-toggle-row{display:flex;gap:5px;flex-wrap:wrap;align-items:end}.cert-toggle-row .icon-btn{width:32px;height:32px}.cert-toggle-row button.active{border-color:#93c5fd;background:#eff6ff}.cert-check-compact{display:flex;align-items:center;gap:5px;min-height:32px;white-space:nowrap}.cert-check-compact input{width:auto}.cert-prop-title{align-self:center;margin-right:2px;color:#334155;font-size:13px}.cert-font-picker{position:relative;flex:0 1 290px;min-width:min(290px,100%)}.cert-font-current{position:relative;width:100%;min-height:32px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;text-align:left;padding:6px 24px 6px 8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cert-font-current:after{content:"";position:absolute;right:9px;bottom:13px;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #64748b}.cert-font-menu{position:absolute;left:0;top:100%;z-index:80;width:min(420px,80vw);max-height:320px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.18);padding:8px}.cert-font-menu input{margin-bottom:7px}.cert-font-option{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;align-items:center;border:0;border-radius:7px;background:#fff;padding:8px;text-align:left;cursor:pointer}.cert-font-option:hover,.cert-font-option:focus-visible{background:#eff6ff}.cert-font-option strong,.cert-font-option small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cert-font-option small{grid-column:1/2;color:#64748b}.cert-font-option .badge{grid-column:2;grid-row:1/3;font-family:Segoe UI,Arial,sans-serif}
.cert-layer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.cert-layer.active{border-color:#93c5fd;background:#eff6ff}.cert-layer-actions{display:flex;gap:5px}.cert-layer-actions button{width:30px;height:30px}.cert-render-viewport{width:100%;overflow:auto}.cert-render-stage{position:relative;margin:0 auto;background:#fff;border:1px solid var(--line);box-shadow:0 18px 40px rgba(15,23,42,.16);overflow:hidden;transform-origin:top center}.cert-render-bg{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;transform-origin:center center}.cert-render-bg-media{position:absolute;display:block;max-width:none;max-height:none}.cert-render-empty{position:absolute;inset:0;display:grid;place-items:center;background:#f8fafc;color:#94a3b8}.cert-render-el{position:absolute;overflow:hidden;display:flex;align-items:center;justify-content:center}.cert-render-text{white-space:pre-wrap;padding:2px 5px}.cert-render-content{position:absolute;display:block;max-width:none;max-height:none}.cert-render-image img,.cert-render-qr svg{width:100%;height:100%;object-fit:contain}.cert-render-placeholder-img{border:1px dashed #94a3b8;background:#f8fafc;color:#64748b;font-weight:700;text-align:center}.cert-render-placeholder-img .cert-render-content{display:grid;place-items:center;background:#f8fafc;color:#64748b}.cert-render-qr .cert-render-content svg{width:100%;height:100%;display:block}
.cert-focus-mode{overflow:hidden}.cert-focus-mode .sidebar,.cert-focus-mode .topbar{display:none}.cert-focus-mode .content{padding:8px}.cert-focus-mode .cert-designer{height:calc(100vh - 16px);grid-template-rows:auto auto minmax(0,1fr)}.cert-focus-mode .cert-toolbar{top:0}.cert-focus-mode .cert-propbar{top:60px}.cert-focus-mode .cert-designer-grid{grid-template-columns:245px minmax(0,1fr) 225px;min-height:0}.cert-focus-mode .cert-panel{max-height:calc(100vh - 150px)}.cert-focus-mode .cert-canvas-wrap{min-height:calc(100vh - 150px)}.cert-focus-mode .cert-canvas-scroll{height:calc(100vh - 152px);padding:26px}
@media(max-width:1200px){.cert-designer-grid{grid-template-columns:230px minmax(620px,1fr) 220px}.cert-canvas-wrap{overflow:auto}}
@media(max-width:900px){.cert-toolbar{position:static;align-items:flex-start;flex-direction:column}.cert-designer-grid{grid-template-columns:1fr}.cert-panel{max-height:none}.cert-canvas-scroll{height:auto;min-height:520px}.cert-canvas-wrap{min-height:560px}}
