*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}html,body{width:100%;height:100dvh;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,SF Pro,Segoe UI,sans-serif;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;background:#f5f5f5;color:#1a1a1a}#app{display:flex;flex-direction:column;height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.tab-bar{display:flex;gap:14px;padding:12px 24px;background:#fff;border-bottom:1px solid rgba(0,0,0,.08);flex-shrink:0}.tab-btn{display:flex;align-items:center;justify-content:center;gap:10px;flex:1;height:56px;border:none;border-radius:16px;cursor:pointer;font-size:22px;font-weight:700;background:#ff950014;color:#00000073;transition:all .25s ease}.tab-btn.active{background:#ff9500;color:#fff}.tab-btn svg{width:24px;height:24px;fill:currentColor}.top-bar{display:flex;align-items:center;gap:16px;padding:10px 20px;background:#fff;border-bottom:1px solid rgba(0,0,0,.08);flex-shrink:0}.home-btn{display:flex;align-items:center;gap:8px;height:56px;padding:0 24px;border:none;border-radius:28px;cursor:pointer;background:#ff9500;color:#fff;font-size:20px;font-weight:700}.home-btn svg{width:26px;height:26px;fill:currentColor}.top-bar-color{flex:1;display:flex;align-items:center;justify-content:center;gap:12px}.top-bar-color-dot{width:40px;height:40px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px #0000001f,0 2px 6px #00000026;flex-shrink:0;transition:background .15s ease}.top-bar-color-label{font-size:18px;font-weight:700;color:#1a1a1a;white-space:nowrap}.share-btn{width:56px;height:56px;border:none;border-radius:50%;cursor:pointer;background:#ff9500;color:#fff;display:flex;align-items:center;justify-content:center}.share-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.coloring-view{display:flex;flex:1;overflow:hidden}.tool-sidebar{width:84px;background:#fff;border-right:1px solid rgba(0,0,0,.06);display:flex;flex-direction:column;align-items:center;padding-top:12px;flex-shrink:0}.tool-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:72px;height:64px;border:none;border-radius:16px;cursor:pointer;background:transparent;color:#0000008c;margin-bottom:8px;transition:all .2s ease}.tool-btn.active{background:#ff9500;color:#fff}.tool-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.tool-btn.active svg{stroke:#fff}.tool-btn.fill-icon svg{fill:currentColor;stroke:none}.tool-btn.active.fill-icon svg{fill:#fff}.tool-btn span{font-size:11px;font-weight:600}.tool-sidebar .divider{width:calc(100% - 20px);height:1px;background:#0000000f;margin:8px 0}.size-slider-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;padding:0 8px}.size-dot-big{width:14px;height:14px;border-radius:50%;background:#0006}.size-dot-small{width:6px;height:6px;border-radius:50%;background:#0006}.size-slider-wrap input[type=range]{writing-mode:vertical-lr;direction:rtl;width:28px;height:120px;accent-color:#ff9500}.tool-sidebar .spacer{flex:1}.undo-redo-wrap{display:flex;flex-direction:column;gap:8px;padding-bottom:16px}.undo-btn,.redo-btn{width:64px;height:52px;border:none;border-radius:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff}.undo-btn{background:#2196f3}.redo-btn{background:#2196f3a6}.undo-btn svg,.redo-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.color-sidebar{width:112px;background:#fff;border-left:1px solid rgba(0,0,0,.06);display:flex;flex-direction:column;align-items:center;flex-shrink:0;overflow-y:auto}.selected-color-indicator{position:relative;width:55px;height:55px;margin-top:14px;margin-bottom:6px}.selected-color-indicator .inner{width:52px;height:52px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1px #0000001f,0 2px 4px #00000026;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.opacity-slider-wrap{display:flex;flex-direction:column;align-items:center;gap:3px;padding-bottom:4px}.opacity-dot{border-radius:50%}.opacity-slider-wrap input[type=range]{writing-mode:vertical-lr;direction:rtl;width:22px;height:80px;accent-color:#ff9500}.color-sidebar .divider{width:calc(100% - 16px);height:1px;background:#0000000f}.color-grid{display:grid;grid-template-columns:42px 42px;gap:8px;padding:10px}.color-btn{width:42px;height:42px;border-radius:50%;border:1px solid rgba(0,0,0,.12);cursor:pointer;transition:transform .12s ease}.color-btn:active{transform:scale(.88)}.color-btn.selected{border:3px solid #ff9500;transform:scale(1.1)}.color-btn.selected .checkmark{display:block}.color-picker-native{width:44px;height:44px;border:none;padding:0;cursor:pointer;margin:8px 0}.canvas-area{flex:1;position:relative;background:#fff;overflow:hidden;touch-action:none}.canvas-row{display:flex;transform-origin:0 0}.canvas-container{position:relative}.canvas-container canvas{position:absolute;top:0;left:0}.reference-container{position:relative;background:#fafafa;border-radius:4px;overflow:hidden}.reference-container canvas{display:block}.reference-label{position:absolute;bottom:8px;left:50%;transform:translate(-50%);background:#00000080;color:#fff;font-size:12px;font-weight:600;padding:4px 12px;border-radius:12px;pointer-events:none}.zoom-controls{position:absolute;bottom:10px;right:10px;display:flex;flex-direction:column;background:#ffffffd9;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border-radius:10px;box-shadow:0 2px 8px #0000001a;overflow:hidden;z-index:10}.zoom-btn{width:36px;height:36px;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;color:#1a1a1a}.zoom-btn:active{background:#0000000d}.zoom-controls .zdivider{width:20px;height:1px;background:#0000001a;margin:0 auto}.gallery{flex:1;overflow-y:auto;background:#f2f2f7;padding:16px 24px}.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:24px}.page-card{background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 3px 8px #0000001a;cursor:pointer;transition:transform .15s ease}.page-card:active{transform:scale(.97)}.page-card-image{position:relative;aspect-ratio:1;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}.page-card-image img{width:calc(100% - 24px);height:calc(100% - 24px);object-fit:contain}.page-card-image .badge{position:absolute;top:10px;right:10px;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:14px;font-weight:700}.badge.in-progress{background:#ff9500}.badge.completed{background:#4caf50}.page-card-info{padding:12px 14px;font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gallery-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:80px;gap:20px;color:#00000080}.gallery-empty .icon{font-size:72px;opacity:.5}.gallery-empty h2{font-size:24px;font-weight:700;color:#1a1a1a}.gallery-empty p{font-size:18px}.ai-generator{flex:1;overflow-y:auto;background:#f2f2f7;padding:16px 24px}.ai-generator h1{font-size:34px;font-weight:700;text-align:center;margin-bottom:6px}.ai-generator .subtitle{font-size:15px;color:#00000080;text-align:center;margin-bottom:24px}.mode-picker{display:flex;gap:0;background:#0000000f;border-radius:10px;padding:2px;margin-bottom:24px}.mode-picker button{flex:1;height:36px;border:none;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600;background:transparent;color:#0009;transition:all .2s ease}.mode-picker button.active{background:#fff;color:#1a1a1a;box-shadow:0 1px 4px #0000001a}.category-chips{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px;margin-bottom:16px}.category-chip{flex-shrink:0;padding:8px 14px;border-radius:20px;border:1px solid rgba(0,0,0,.15);background:#fff;color:#1a1a1a;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}.category-chip.active{background:#ff9500;color:#fff;border-color:transparent}.prompt-field{width:100%;min-height:80px;padding:16px;border:1px solid rgba(0,0,0,.15);border-radius:16px;background:#fff;font-size:16px;font-family:inherit;resize:vertical;margin-bottom:16px}.suggestions{margin-bottom:24px}.suggestions h3{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:#00000080;margin-bottom:10px}.suggestion-chips{display:flex;flex-wrap:wrap;gap:8px}.suggestion-chip{padding:7px 12px;border-radius:20px;border:1px solid rgba(0,0,0,.15);background:#fff;color:#1a1a1a;font-size:14px;cursor:pointer}.suggestion-chip:hover{background:#ff950014}.generate-btn{width:100%;height:52px;border:none;border-radius:16px;cursor:pointer;background:#ff9500;color:#fff;font-size:18px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:24px}.generate-btn:disabled{opacity:.4;cursor:not-allowed}.loading-indicator{display:flex;flex-direction:column;align-items:center;gap:16px;padding:32px;background:#fff;border-radius:20px}.spinner{width:40px;height:40px;border:4px solid rgba(255,149,0,.2);border-top-color:#ff9500;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.error-banner{display:flex;align-items:center;gap:12px;padding:14px;background:#e5393514;border:1px solid rgba(229,57,53,.2);border-radius:14px;margin-bottom:16px}.error-banner .dismiss{border:none;background:none;cursor:pointer;color:#0006;font-size:18px}.result-card{background:#fff;border-radius:24px;padding:20px}.result-card h2{font-size:22px;font-weight:700;text-align:center;margin-bottom:20px}.result-card img{width:100%;max-height:400px;object-fit:contain;border-radius:16px;margin-bottom:20px}.result-actions{display:flex;gap:16px}.result-actions button{flex:1;height:48px;border-radius:14px;cursor:pointer;font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:6px}.btn-outline{border:2px solid #ff9500;background:transparent;color:#ff9500}.btn-primary{border:none;background:#ff9500;color:#fff}.photo-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;height:200px;border-radius:20px;background:#ff95000d;border:2px dashed rgba(255,149,0,.4);cursor:pointer;margin-bottom:24px}.photo-drop .icon{font-size:48px;color:#ff9500}.photo-input{display:none}
