@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&family=IBM+Plex+Mono&display=swap');
:root{font-family:Vazirmatn,sans-serif;color:#18212d;background:#e9edf2;--surface:#f8fafc;--border:#d4dbe4;--muted:#6b7888;--blue:#2457d6}
*{box-sizing:border-box}body{margin:0;height:100vh;overflow:hidden}.topbar,.toolbar{display:flex;align-items:center;gap:9px;background:var(--surface);border-bottom:1px solid var(--border);padding:8px 14px}.topbar{height:60px}.brand{display:flex;align-items:center;gap:9px;min-width:145px}.mark{display:grid;place-items:center;background:var(--blue);color:white;width:34px;height:34px;border-radius:8px;font-size:20px}.brand strong,.brand small{display:block}.brand small{font-size:10px;color:var(--muted)}.project-title{width:170px;border:1px solid var(--border);border-radius:6px;padding:7px;background:white;font:inherit}.menus{display:flex;gap:18px;color:#455264;font-size:12px;flex:1}.actions{display:flex;gap:6px}button{font:inherit;border:1px solid var(--border);background:white;color:#263548;padding:7px 10px;border-radius:6px;cursor:pointer;font-size:12px}button:hover{border-color:#9aabc0;background:#f1f5fb}.primary{background:var(--blue);color:white;border-color:var(--blue)}.toolbar{height:43px;overflow-x:auto;white-space:nowrap}.toolbar button{padding:5px 8px;font-size:11px}.spacer{flex:1}.workspace{height:calc(100vh - 103px);display:grid;grid-template-columns:55px minmax(250px,1fr) 270px;direction:ltr}.tools{background:#eef1f5;border-right:1px solid var(--border);display:flex;align-items:center;flex-direction:column;gap:7px;padding:12px 0}.tools button{width:35px;height:35px;font-size:18px;padding:0}.tools button.active{background:#dce7ff;color:var(--blue);border-color:#9db5f0}.stage{min-width:0;display:flex;flex-direction:column;direction:rtl}.stage-head,footer{height:36px;display:flex;align-items:center;gap:14px;padding:0 13px;background:var(--surface);border-bottom:1px solid var(--border);font-size:11px}.stage-head span:last-child{margin-right:auto;color:var(--muted)}.canvas-wrap{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto;background-color:#e8edf3;background-image:radial-gradient(#cbd4df .8px,transparent .8px);background-size:17px 17px;padding:40px}.ruler{position:absolute;top:9px;left:50%;transform:translateX(-50%);font:10px 'IBM Plex Mono';color:#8290a1;direction:ltr}#canvas{width:min(760px,100%);max-height:calc(100% - 10px);aspect-ratio:760/520;background:white;border:1px solid #cbd4df;box-shadow:0 8px 28px #18212d20;touch-action:none;flex:none}.hint{position:absolute;bottom:8px;right:12px;font-size:10px;color:#778596}footer{border-top:1px solid var(--border);border-bottom:0;color:var(--muted)}.properties{background:var(--surface);border-left:1px solid var(--border);padding:14px;overflow:auto;direction:rtl}.panel-title{font-size:12px;font-weight:700;margin-bottom:13px}.muted{font-size:11px;color:var(--muted);line-height:2}.field{display:flex;justify-content:space-between;align-items:center;margin:10px 0;font-size:11px;color:#657386;gap:8px}.field input[type=text],.field input[type=number]{width:115px;min-width:0;border:1px solid var(--border);border-radius:5px;padding:5px;font:11px Vazirmatn}.field input[type=color]{width:40px;height:28px;border:0;background:none}.field input[type=range]{width:115px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:7px}.layer{display:flex;width:100%;justify-content:space-between;margin:3px 0;text-align:right}.layer.selected{background:#dce7ff;border-color:#a9bff3;color:#183f9e}.danger{color:#bd3547}.btnrow{display:flex;gap:6px;margin:12px 0}.btnrow button{flex:1}hr{border:0;border-top:1px solid var(--border);margin:16px 0}.dark{filter:none;background:#171d26;color:#e7edf5}.dark .topbar,.dark .toolbar,.dark .properties,.dark .stage-head,.dark footer{background:#202834;color:#e7edf5;border-color:#384555}.dark button,.dark .project-title{background:#293441;color:#e7edf5;border-color:#384555}.dark .tools{background:#1b232e}.dark .canvas-wrap{background-color:#171d26}.dark .menus{color:#c4cfdd}@media(max-width:900px){.workspace{grid-template-columns:48px 1fr}.properties{display:none}.menus{display:none}}@media(max-width:560px){.brand{min-width:auto}.brand small,.project-title{display:none}.topbar{padding:6px}.toolbar{gap:4px;padding:5px}.toolbar button{font-size:10px}.canvas-wrap{padding:12px}#canvas{width:100%}}
/* Keep pointer drawing responsive on touch and pen devices */
#canvas, svg.artboard { touch-action: none; }
