*{box-sizing:border-box}html,body{max-width:100%;overflow-x:hidden}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:#f4f5f7;color:#111827}.app{max-width:1100px;margin:0 auto;padding:1rem}.header h1{margin:0;font-size:1.6rem}.header p{margin:.25rem 0 1rem;color:#4b5563}.error{background:#fee2e2;color:#991b1b;padding:.75rem 1rem;border-radius:.5rem;margin-bottom:1rem}.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;min-height:14rem;border:2px dashed #9ca3af;border-radius:1rem;background:#fff;cursor:pointer;text-align:center;padding:1rem}.drop:hover{border-color:#2563eb}.drop-title{font-size:1.2rem;font-weight:700}.drop-hint{color:#6b7280}.editor{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:1rem;align-items:start}.preview,.panel{background:#fff;border-radius:1rem;padding:1rem}.preview canvas{width:100%;height:auto;display:block;border-radius:.5rem;touch-action:none;cursor:move;background:repeating-conic-gradient(#e5e7eb 0,#e5e7eb 25%,#fff 0,#fff 50%) 0 0 / 16px 16px}.toolbar,.add-row{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.75rem}.add-row{margin-top:0}.meta{margin-left:auto;color:#6b7280;font-size:.85rem}.btn{min-height:44px;padding:0 1rem;border:0;border-radius:.5rem;background:#e5e7eb;font:inherit;font-weight:600;cursor:pointer;display:inline-flex;align-items:center}.btn:hover{background:#d1d5db}.btn-ghost{background:transparent;border:1px solid #d1d5db}.btn-small{min-height:44px;padding:0 .75rem}.btn-primary{width:100%;background:#2563eb;color:#fff;margin-top:1rem;justify-content:center}.btn-primary:hover{background:#1d4ed8}.btn:disabled{opacity:.6;cursor:progress}.panel h2{font-size:1rem;margin:1rem 0 .5rem}.muted{color:#6b7280;font-size:.9rem}.list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem}.item{border:1px solid #e5e7eb;border-radius:.5rem;padding:.5rem .75rem}.item.selected{border-color:#2563eb;box-shadow:0 0 0 2px #bfdbfe}.item-head{display:flex;justify-content:space-between;align-items:center}.field{display:grid;gap:.25rem;margin-top:.5rem;font-size:.85rem;color:#4b5563;flex:1}.field textarea{min-height:44px;padding:.6rem .75rem;border:1px solid #d1d5db;border-radius:.5rem;font:inherit;resize:vertical}.field input[type=text]{min-height:44px;padding:0 .75rem;border:1px solid #d1d5db;border-radius:.5rem;font:inherit}.field input[type=color]{width:100%;height:44px;padding:2px;border:1px solid #d1d5db;border-radius:.5rem;background:#fff}.field input[type=range]{width:100%;height:44px}.color-row{display:flex;gap:.5rem;align-items:center}.color-row input[type=color]{width:56px;flex:none}.color-row .hex{flex:1;min-width:0;font-family:ui-monospace,Menlo,Consolas,monospace;text-transform:lowercase}.color-row .hex.invalid{border-color:#dc2626}.field,.field-row>*{min-width:0}.field textarea,.field input[type=text]{width:100%;max-width:100%}.panel,.preview,.item{min-width:0}.field-row{flex-wrap:wrap;display:flex;gap:.75rem}.progress{height:8px;background:#e5e7eb;border-radius:4px;overflow:hidden;margin-top:.5rem}.progress div{height:100%;background:#2563eb;transition:width .1s}.notice{background:#dcfce7;color:#166534;padding:.75rem 1rem;border-radius:.5rem;margin-bottom:1rem}.btn-block{width:100%;justify-content:center;margin-top:.5rem}.gallery{margin-top:1.5rem}.gallery h2{font-size:1.1rem}.thumbs{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.75rem}.thumb{background:#fff;border-radius:.75rem;padding:.5rem;display:grid;gap:.25rem}.thumb-img{aspect-ratio:1 / 1;display:flex;align-items:center;justify-content:center;background:#f3f4f6;border-radius:.5rem;overflow:hidden}.thumb-img img{max-width:100%;max-height:100%}.thumb-actions{display:flex;gap:.25rem;flex-wrap:wrap}.thumb-actions .btn{flex:1;justify-content:center;padding:0 .5rem}.editing{background:#dbeafe;color:#1e3a8a;padding:.5rem 1rem;border-radius:.5rem;margin-bottom:1rem}.search{background:#fff;border-radius:1rem;padding:1rem;margin-top:1rem}.search h2{font-size:1.1rem;margin:0 0 .5rem}.search-form{display:flex;gap:.5rem;flex-wrap:wrap}.search-form input{flex:1;min-width:12rem;min-height:44px;padding:0 .75rem;border:1px solid #d1d5db;border-radius:.5rem;font:inherit}.btn-inline{width:auto;margin-top:0}.results{list-style:none;margin:.75rem 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.5rem}.result{position:relative;width:100%;aspect-ratio:1 / 1;padding:0;border:0;border-radius:.5rem;overflow:hidden;background:#f3f4f6;cursor:pointer}.result img{width:100%;height:100%;object-fit:cover;display:block}.result:disabled{opacity:.7;cursor:progress}.result-busy{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#ffffffb3;font-weight:600;font-size:.85rem}.attribution{margin:.5rem 0 0;font-size:.75rem}.frame-strip{display:flex;gap:.5rem;overflow-x:auto;padding:.5rem .25rem;margin:.5rem 0}.frame-thumb{flex:none;display:grid;gap:.25rem;justify-items:center;padding:.25rem;border:2px solid transparent;border-radius:.5rem;background:#f3f4f6;cursor:pointer;font:inherit;font-size:.75rem;min-height:44px}.frame-thumb.active{border-color:#2563eb;background:#dbeafe}.frame-thumb canvas{display:block;border-radius:.25rem}.frame-add{flex:none;min-width:96px;min-height:44px;border:2px dashed #9ca3af;border-radius:.5rem;background:transparent;font:inherit;font-weight:600;cursor:pointer}.frame-add:hover{border-color:#2563eb}.builder-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:1rem;align-items:start}.builder-stage canvas{width:100%;height:auto;display:block;border-radius:.5rem;touch-action:none;cursor:move}.preview-box{margin-top:.75rem;padding:.75rem;background:#f3f4f6;border-radius:.75rem;display:grid;gap:.5rem;justify-items:start}.preview-canvas{max-width:100%;height:auto;border-radius:.5rem;display:block}.frame-title{margin:.75rem 0 .25rem;font-size:1rem}@media (max-width: 800px){.builder-grid{grid-template-columns:minmax(0,1fr)}}.tpl-row{display:flex;flex-wrap:wrap;gap:.5rem;margin:.5rem 0 .75rem}.slide-list{margin-bottom:.75rem}.builder select{min-height:44px;padding:0 .5rem;border:1px solid #d1d5db;border-radius:.5rem;font:inherit;background:#fff}.builder-options{margin-top:.75rem}.check{display:flex;align-items:center;gap:.5rem;min-height:44px;margin-top:.25rem}.check input{width:20px;height:20px}.file-name{margin-left:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:12rem}.builder[hidden]{display:none}.save-name{margin-top:1rem}.btn-danger{background:#dc2626;color:#fff}.btn-danger:hover{background:#b91c1c}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:50}.modal{background:#fff;border-radius:1rem;padding:1.25rem;max-width:420px;width:100%}.modal h3{margin:0 0 .5rem}.modal-actions{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem}.thumb-name{font-weight:600;font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 801px){.preview{position:sticky;top:1rem}}@media (max-width: 800px){.editor{grid-template-columns:minmax(0,1fr)}}
