
 :root{--bg:#fff0e6;--surface:#fff;--soft:#fff7f1;--border:#e2e8f0;--text:#0f172a;--muted:#64748b;--primary:#4f46e5;--pink:#ec4899;--green:#10b981;--shadow:0 10px 25px -5px #0f172a12}
*{box-sizing:border-box;margin:0;padding:0;font-family:'Plus Jakarta Sans',sans-serif}
body{height:100vh;overflow:hidden;display:flex;flex-direction:column;background:linear-gradient(135deg,#fff7f0,#ffdfcc);color:var(--text)}
button,input,select,textarea{font:inherit}button{cursor:pointer}
.navbar{height:60px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;background:#ffffffed;border-bottom:1px solid var(--border);flex-shrink:0;z-index:5}
.brand{font-weight:800;font-size:1.18rem;white-space:nowrap;cursor:pointer}.logo{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:9px;color:white;background:linear-gradient(135deg,var(--primary),var(--pink));margin-right:8px}
.modes{display:flex;gap:4px;background:var(--soft);padding:4px;border:1px solid var(--border);border-radius:12px}
.mode,.btn,.toolbtn{border:1px solid var(--border);border-radius:8px;background:white;padding:8px 12px;font-size:.8rem;font-weight:700;color:var(--text)}
.mode{border:0;background:transparent;color:var(--muted)}.mode.active{background:white;color:var(--primary);box-shadow:0 2px 8px #0f172a0a}
.btn.primary{background:linear-gradient(135deg,var(--primary),#6366f1);border:0;color:white}.btn:hover,.toolbtn:hover{border-color:var(--primary);color:var(--primary)}.btn.primary:hover{color:white}
.navright{display:flex;align-items:center;gap:7px}.resolution{padding:8px;border:1px solid var(--border);border-radius:8px;background:white;max-width:95px;font-size:.78rem}.account-btn{white-space:nowrap}.site-description{width:min(100%,900px);margin:36px auto 12px;padding:24px;border:1px solid var(--border);border-radius:18px;background:#fff;text-align:left;color:var(--muted);line-height:1.75}.site-description h2{color:var(--text);font-size:1.2rem;margin-bottom:8px}.auth-modal{position:fixed;inset:0;z-index:30;background:#0f172a99;display:none;align-items:center;justify-content:center;padding:18px}.auth-card{width:min(100%,420px);background:#fff;border-radius:18px;padding:24px;box-shadow:0 20px 60px #0003}.auth-card h2{margin-bottom:8px}.auth-card p{color:var(--muted);font-size:.9rem;line-height:1.6;margin-bottom:16px}.auth-actions{display:flex;gap:8px;flex-wrap:wrap}.ratio{padding:8px;border:1px solid var(--border);border-radius:8px;background:white;max-width:180px;font-size:.78rem}
.view{display:none;flex:1;min-height:0;overflow:hidden}.view.active{display:flex}
.hub{overflow:auto;flex-direction:column;align-items:center;padding:34px 22px}.hero{text-align:center;max-width:760px;margin:10px auto 28px}.badge{display:inline-block;background:#eef2ff;color:var(--primary);border-radius:99px;padding:6px 12px;font-size:.75rem;font-weight:800;margin-bottom:12px}.hero h1{font-size:clamp(1.8rem,4vw,2.6rem);line-height:1.15;margin-bottom:12px}.hero p{color:var(--muted);line-height:1.7}
.launch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;width:min(100%,950px);margin-bottom:32px}.launchcard{padding:22px;background:white;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);cursor:pointer}.launchcard:hover{border-color:var(--primary);transform:translateY(-2px)}.launchcard .emoji{font-size:1.6rem}.launchcard h3{margin:12px 0 5px}.launchcard p{font-size:.82rem;color:var(--muted);line-height:1.5}
.toolhead{display:flex;justify-content:space-between;align-items:center;width:min(100%,1050px);gap:12px;margin-bottom:14px}.search{padding:10px 12px;border:1px solid var(--border);border-radius:9px;width:min(280px,55vw)}
.toolgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;width:min(100%,1050px)}.tile{display:flex;gap:12px;padding:15px;background:white;border:1px solid var(--border);border-radius:12px;cursor:pointer}.tile:hover{border-color:var(--primary)}.tileicon{background:#eef2ff;color:var(--primary);border-radius:9px;padding:10px;height:42px}.tile h4{font-size:.88rem;margin-bottom:4px}.tile p{font-size:.75rem;color:var(--muted);line-height:1.4}
.editor{flex-direction:column;width:100%;min-height:0}.upper{display:flex;flex:1;min-height:0}.rail{width:66px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 5px;background:white;border-right:1px solid var(--border)}.rail button{width:54px;height:52px;border:0;background:transparent;border-radius:9px;color:var(--muted);font-size:.68rem;font-weight:700}.rail button span{display:block;font-size:1.2rem;margin-bottom:3px}.rail button.active,.rail button:hover{background:#eef2ff;color:var(--primary)}
.drawer{width:250px;flex-shrink:0;background:white;border-right:1px solid var(--border);padding:14px;overflow:auto}.drawer h3{font-size:.95rem;margin-bottom:12px}.drop{border:2px dashed #cbd5e1;border-radius:12px;padding:20px 10px;text-align:center;background:var(--soft);cursor:pointer;font-size:.82rem;margin-bottom:16px}.drop p{font-size:.72rem;color:var(--muted);margin-top:6px}.presets{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-bottom:16px}.preset{padding:10px 5px;border:1px solid var(--border);border-radius:8px;background:var(--soft);font-size:.74rem;font-weight:700;text-align:center;cursor:pointer}.preset:hover,.preset.active{border-color:var(--primary);background:#eef2ff;color:var(--primary)}
.stage{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px;position:relative;overflow:auto}.canvaswrap{display:flex;align-items:center;justify-content:center;background:#111827;border-radius:12px;overflow:hidden;box-shadow:var(--shadow);max-width:100%;max-height:calc(100% - 55px)}canvas#canvas{display:block;max-width:100%;max-height:100%;object-fit:contain;cursor:crosshair}.transport{display:flex;align-items:center;gap:10px;padding:7px 12px;border:1px solid var(--border);border-radius:999px;background:white;margin-top:10px;box-shadow:var(--shadow)}.play{border:0;border-radius:50%;width:32px;height:32px;background:var(--primary);color:white}
.inspector{width:265px;flex-shrink:0;padding:14px;background:white;border-left:1px solid var(--border);overflow:auto}.group{padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid var(--border)}.group h4{font-size:.73rem;color:var(--muted);letter-spacing:.5px;text-transform:uppercase;margin-bottom:11px}.slider{margin:10px 0}.slider label{display:flex;justify-content:space-between;font-size:.75rem;font-weight:700;margin-bottom:5px}.slider input{width:100%;accent-color:var(--primary)}.smallselect,.field{width:100%;padding:8px;border:1px solid var(--border);border-radius:8px;background:white;font-size:.8rem;margin:4px 0}
.timeline{height:190px;flex-shrink:0;background:white;border-top:1px solid var(--border);display:flex;flex-direction:column}.timelinebar{height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 12px;background:var(--soft);border-bottom:1px solid var(--border);gap:8px}.tlbuttons{display:flex;gap:6px;flex-wrap:wrap}.toolbtn{padding:5px 9px;font-size:.72rem}.tracks{overflow:auto;padding:9px 12px;position:relative;flex:1}.track{display:flex;align-items:center;height:32px;margin-bottom:6px;min-width:580px;gap:8px}.trackname{width:115px;flex-shrink:0;font-size:.7rem;font-weight:800;color:var(--muted)}.lane{height:100%;flex:1;position:relative;border:1px solid var(--border);background:var(--soft);border-radius:6px;overflow:hidden}.clip{position:absolute;top:2px;bottom:2px;border-radius:4px;padding:3px 8px;color:white;font-size:.69rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:grab}.clip.video{background:linear-gradient(90deg,#4f46e5,#818cf8)}.clip.text{background:linear-gradient(90deg,#ec4899,#f43f5e)}.clip.audio{background:linear-gradient(90deg,#059669,#34d399)}.clip.pip{background:linear-gradient(90deg,#d97706,#f59e0b)}.playhead{position:absolute;top:0;bottom:0;width:2px;background:var(--pink);left:135px;pointer-events:none;z-index:3}





.toast{position:fixed;right:20px;bottom:18px;background:#0f172a;color:white;padding:12px 16px;border-radius:10px;opacity:0;transform:translateY(8px);transition:.2s;z-index:20;font-size:.8rem;pointer-events:none}.toast.show{opacity:1;transform:none}
.hidden{display:none!important}.hint{font-size:.73rem;color:var(--muted);line-height:1.5;margin:8px 0}.row{display:flex;gap:6px}.row>*{min-width:0;flex:1}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #a5b4fc;outline-offset:2px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

@media(max-width:1050px){.inspector{width:220px}.drawer{width:220px}.navright .ratio{display:none}.modes .mode{padding:7px 8px;font-size:.72rem}}
@media(max-width:760px){body{height:100dvh}.navbar{height:auto;min-height:58px;flex-wrap:wrap;padding:8px}.brand{font-size:1rem}.modes{order:3;width:100%;justify-content:center}.navright .btn:not(.primary){display:none}.launch{grid-template-columns:1fr}.upper{flex-wrap:wrap;overflow:auto}.rail{width:100%;height:58px;flex-direction:row;justify-content:center;border-right:0;border-bottom:1px solid var(--border);padding:4px}.rail button{height:48px}.drawer{width:44%;min-width:155px;max-height:42%;}.inspector{width:56%;max-height:42%;border-left:1px solid var(--border)}.stage{min-height:300px;order:3;flex-basis:100%;height:45vh}.upper{align-content:flex-start}.timeline{height:175px}.toolhead{align-items:flex-start;flex-direction:column}}

/* Added Motion Studio */
#view-motion{display:none;flex-direction:column;min-height:0;overflow:auto;background:var(--bg)}
#view-motion.active{display:flex}
.motion-top{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:12px 16px;background:#fff;border-bottom:1px solid var(--border)}
.motion-work{display:grid;grid-template-columns:minmax(210px,250px) minmax(280px,1fr) minmax(220px,280px);gap:12px;padding:12px;min-height:0;flex:1}
.motion-panel{background:#fff;border:1px solid var(--border);border-radius:12px;padding:13px;overflow:auto}
.motion-panel h3{font-size:.9rem;margin-bottom:10px}
.motion-canvas-area{display:flex;align-items:center;justify-content:center;min-height:320px;background:#ffe8d9;border-radius:12px;padding:12px}
#motionCanvas{display:block;max-width:100%;max-height:58vh;background:#111827;border-radius:8px;box-shadow:var(--shadow)}
.motion-controls{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:10px}
.motion-controls button,.motion-panel button{border:1px solid var(--border);background:#fff;border-radius:8px;padding:7px 9px;font-size:.75rem;font-weight:700}
.motion-controls .primary{background:var(--primary);color:#fff}
.motion-slider{margin:10px 0}
.motion-slider label{display:flex;justify-content:space-between;font-size:.74rem;font-weight:700;margin-bottom:4px}
.motion-slider input{width:100%;accent-color:var(--primary)}
.motion-track{position:relative;height:36px;border:1px solid var(--border);border-radius:7px;background:#f8fafc;margin:8px 0;overflow:hidden}
.motion-clip{position:absolute;inset:3px 0;border-radius:5px;background:linear-gradient(90deg,#4f46e5,#818cf8);color:white;padding:7px;font-size:.7rem}
.motion-diamond{position:absolute;top:50%;width:10px;height:10px;padding:0!important;transform:translate(-50%,-50%) rotate(45deg);background:#fbbf24!important;border:2px solid #78350f!important;z-index:2}
.motion-kf-list{display:flex;gap:5px;flex-wrap:wrap}
.motion-kf-list button{background:#fef3c7;border-color:#fde68a;color:#92400e}
.motion-status{font-size:.74rem;color:var(--muted);line-height:1.5;margin-top:8px}
@media(max-width:900px){.motion-work{grid-template-columns:1fr}.motion-canvas-area{min-height:250px}#motionCanvas{max-height:45vh}}


/* FINAL FIX: layout presets must never render in Tools Hub, Editor, or Motion Studio. */



/* Creative text controls */
.creative-controls{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}.creative-controls label{display:flex;flex-direction:column;gap:5px;font-size:.76rem;font-weight:700;color:var(--muted)}.creative-controls .field{width:100%;min-width:0}.creative-controls input[type=color]{height:40px;padding:3px}.creative-controls input[type=range]{width:100%;accent-color:var(--primary)}.creative-controls label.hint{display:flex;flex-direction:row;align-items:center;gap:6px}.creative-controls label.hint input{width:auto}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #fb923c;outline-offset:2px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}}


/* Apnavox 20-look filter panel */
.pro-filter-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:4px 0 10px}
.pro-filter-count{font-size:.66rem;font-weight:800;color:#047857;background:#d1fae5;padding:4px 7px;border-radius:999px;white-space:nowrap}
.pro-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:310px;overflow-y:auto;padding:2px 4px 4px 0;margin:8px 0 13px;overscroll-behavior:contain}
.pro-filter-btn{min-width:0;padding:9px 7px;border:1px solid var(--border);border-radius:9px;background:linear-gradient(135deg,#fff,#fff7f0);color:var(--text);font-size:.72rem;font-weight:750;text-align:left;cursor:pointer;transition:border-color .15s,transform .15s,background .15s}
.pro-filter-btn:hover{border-color:#fb923c;transform:translateY(-1px)}
.pro-filter-btn.active{border-color:#0f766e;background:#ccfbf1;box-shadow:inset 0 0 0 1px #0f766e;color:#115e59}
.pro-filter-btn .filter-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;background:var(--filter-dot,#fb923c)}
.pro-filter-intensity{display:flex;justify-content:space-between;align-items:center;font-size:.74rem;font-weight:750;margin:8px 0 3px}
.pro-filter-intensity input{width:100%;accent-color:#0f766e}
.pro-filter-help{font-size:.69rem;color:var(--muted);line-height:1.45;margin:8px 0}

/* Apnavox 20-effect drawer */
.effects-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}.effects-head h3{margin:0;font-size:16px}.effects-head>span{font-size:11px;color:#ff007f;background:rgba(255,0,127,.1);padding:4px 7px;border-radius:5px;white-space:nowrap}.effect-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:280px;overflow-y:auto;margin:12px 0 16px;padding:2px 4px 2px 0;overscroll-behavior:contain}.effect-btn{min-width:0;background:#222;border:1px solid #444;color:#f8fafc;padding:10px 8px;border-radius:7px;cursor:pointer;text-align:left;font-size:12px;line-height:1.25;overflow-wrap:anywhere;transition:border-color .15s,background .15s}.effect-btn:hover{border-color:#a855f7}.effect-btn.active{border-color:#ff007f;background:rgba(255,0,127,.13);box-shadow:inset 0 0 0 1px rgba(255,0,127,.15)}

/* Trending sticker and emoji overlay drawer */
.overlay-panel{background:#111;color:#f8fafc;padding:12px;border-radius:12px;width:100%;box-sizing:border-box;font-family:inherit}.overlay-tabs{display:flex;gap:7px;margin-bottom:12px;border-bottom:1px solid #333;padding-bottom:9px}.overlay-tab{flex:1;min-width:0;background:#222;border:1px solid #444;color:#aaa;padding:8px 5px;border-radius:7px;cursor:pointer;font-size:11px;font-weight:650}.overlay-tab span{opacity:.75}.overlay-tab.active{border-color:#00ffcc;color:#fff;background:#153330}.overlay-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:270px;overflow-y:auto;padding:2px 3px 5px 0;overscroll-behavior:contain}.overlay-grid[hidden]{display:none!important}.overlay-item{min-width:0;background:#222;border:1px solid #444;color:#fff;padding:9px 7px;border-radius:7px;cursor:pointer;text-align:left;font-size:11px;line-height:1.3;overflow-wrap:anywhere}.overlay-item:hover,.overlay-item.active{border-color:#00ffcc;background:#16322f}.emojis-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.overlay-item.emoji-item{text-align:center;padding:7px 2px;font-size:22px}.overlay-size-row{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;font-size:11px;margin-top:12px}.overlay-size-row input{width:100%;min-width:0;accent-color:#00c7a5}.overlay-size-row span{font-variant-numeric:tabular-nums;color:#99f6e4}

/* Background removal panel */
.bg-remove-panel{background:#111;color:#f8fafc;padding:12px;border:1px solid #333;border-radius:12px;margin-top:18px;box-sizing:border-box}.bg-remove-panel .presets{display:flex;gap:7px}.bg-remove-panel .preset{flex:1;min-width:0}.bg-remove-panel .hint{display:block}.bg-remove-panel code{font-size:10px;overflow-wrap:anywhere;color:#f9a8d4}.bg-remove-panel input[type=range]{accent-color:#ff007f}
